Interaction scenarios¶
Authentication Process¶
The most important integration scenario with MPass is user authentication.
During this process, if the user is already authenticated, MPass session is not expired and authentication is not forced, user is not requested to proof its identity again. This is actually how single sign-on (SSO) is implemented.
Here is the description of authentication process using MPass:
- The user accesses some protected service resource or explicitly chooses to authenticate in the service. The Browser sends this request to the Service on behalf of user.
- The Service generates an AuthnRequest (authentication request) and signs it using its private key. See AuthnRequest structure description for details.
- The signed AuthnRequest is returned to the Browser in a special redirection page.
- The Browser posts (using HTTP POST method) the request to MPass.
- MPass verifies incoming AuthnRequest and the properties of service registration.
- If user is not already authenticated or the authentication is forced, MPass interacts with sd SSOUserBrowserServiceMPass
- MPass generates and signs a SAML Response with the result of authentication. Note that if AuthnRequest verification fails or user explicitly cancels or refuses the authentication, the SAML Response will be generated with an unsuccessful status. See Response structure description for details.
- The signed Response is returned to the Browser in a special redirection page.
- The Browser posts (using HTTP POST method) the request to Service.
- The Service verifies the Response and creates its own session/cookie or handles the Response is any other specific way. For details on the correct way of this verification process, please refer to Security considerations.
- The Service serves the protected resources to the now authenticated user until its local session expires or the user explicitly request logout (see below).
Logout Process¶
Because users can login into many services during an MPass session, from security point of view SSO is not fully implemented without a proper SLO (Single logout). Integrating services MUST implement both.
Here is the description of logout process using MPass:
- The user explicitly requests to logout. Its Browser submits this request to the Service.
- The Service terminates its local session of the user, i.e. user will have to authenticate again to further access any protected resources.
- The Service generates and signs a LogoutRequest and returns this request to the browser in a special redirection page.
- The Browser posts (using HTTP POST method) the request to MPass.
- If during user’s MPass session, user has authenticated in other services, MPass generates and signs a LogoutRequest for each such service, returning them all to the Browser.
- The Browser posts these requests to respective services.
- Upon LogoutRequest receipt, each service validates the request, then terminates its local session of the user, i.e. user will have to authenticate again to further access service protected resources.
- Each service then generates and signs a LogoutResponse to confirm the logout result and returns this response to the Browser in a special redirection page. Note that for correct logout processing when using HTTP POST, services must return the following header in HTTP response: X Frame Option allow from https://mpass.gov.md
- The Browser sends all the resulted responses to MPass.
- MPass is informed on results after all participating services confirm the logout or after a timeout (to handle the case for services that cannot confirm the logout).
- MPass then terminates its local session of the user, i.e. user will have to authenticate again to access its MPass profile.
- MPass generates and signs a LogoutResponse and returns it to the Browser.
- The Browser posts (using HTTP POST method) the response to Service.
- Finally, after handling the resulting LogoutResponse, the Service is free to return to the user any page that fits the needs.