I have a working setup with a custom plugin to Simplesamlphp. My implementation is on the IDP.
The client has asked me to make SSO login only work for a subset of users. I'm fairly confident that I know where to alter my plugin to restrict this. What I am not sure about is what response the IDP should return in such a case.
I can see an error code urn:oasis:names:tc:SAML:2.0:status:RequestDenied
The SAML responder or SAML authority is able to process the request but has chosen not to respond. This status code MAY be used when there is concern about the security context of the request message or the sequence of request messages received from a particular requester
This doesn't quite seem right. It is not a security context we are worried about. But none of the other error codes seems quite right either. The error is not on the part of the SP or the request itself but due to the user who is making the request.
Should I even be making a SAML response at all? It would be nice if the user went back to the SP with a nice message but perhaps the message should be displayed to them on the IDP.
Is there a correct way to handle this situation?