We register AuthenticationScheme and SAML2Options in startup.cs (.net6 project). During the registration, we set ForceAuthentication = false because the IDP we integrate with has a different login screen for e-sign.
We have to set ForceAuthentication = true only when we request an e-signature.
Our work flow is
- User will login with ForceAuthentication = false.
- In our application, the user has to perform an e-signature. We will have to set ForceAuthentication = true in the SAMLRequest when it is coming from the e-signature page.
I finally found the answer. AuthenticationRequestCreated method will be called when user goes through the authentication Challenge