The SAML2 login can be done in two ways:
- SP-init, where SP sends AuthnRequest to Idp, and Idp responds with a SamlResponse response.
- Idp-initaited, where Idp sends an unsolicited SamlResponse request.
Kentor.AuthServices (the library that manages StubIdp) contains everything you need for logins initiated by Idp. See the source Idp for how this is done.
Logging in with the SP initiative is more complicated, since Idp has to do some validation on the incoming AuthnRequest. These checks are completely absent in Stub Idp (such an idea for a test environment). Implementing an SP initiative entry is certainly possible, but it requires a lot more work.
source share