- The Principal: This is typically the user who requires a service from tries to access a protected resource or service of a service provider entity.
- The Identity Provider: The SAML authority which provides the identity assertion to authenticate a principal An Identity Provider (IdP) is responsible for authenticating users and issuing assertions which include authentication/authorization decisions and user attributes.
- The Service Provider: The SAML consumer which provides service for principalsA Service Provider(SP) consumes the assertions issued by Identity Provider and provides services to the principals.
The main use case scenario covered by SAML is the Principal (the user) requesting access to resource or service from the Service Provider. Then the Service Provider, using SAML, communicates with the Identity Provider to obtain identity assertion. The Service Provider makes the access control decision, depending on this assertion.
SAML 2.0 provides five main specifications:
This article provides more information about above specifications.
SAML 2.0 web browser-based SSO profile
If the user accesses a service at from a service provider:
- The service provider determines which identity provider to use (this is the case when there are multiple identity providers. SAML identity provider discovery profile may be used).
- The service provider generates a SAML message and then redirects the web browser to the identity provider along with the message.
- Identity provider authenticates the user.
- The identity provider generates a SAML message and then redirects the web browser back to the service provider.
- The service provider processes the SAML message and decides to grant or deny access to the user.
Identity-agent-sso is an implementation of all the details discussed above, which can be used to implement SSO enabled web applications. Travelocity is a sample SSO enabled web-app, which is implemented based on Identity-agent-sso.
The RelayState parameter is used so that the service provider can pass some value to the identity provider with the
AuthnRequest and get the same value back with the
Response. This value can be any string and can be useful for service provider application logic (when there is a failure, redirecting to the URL that comes as the RelayState parameter is one way that this can be used).
- For a inbound request to the Identity Server, if the
RelayStateparameter is present, the Identity Server sends back the same value in the response.
- For federation using SAML2, the Identity Server uses the
RelayStateparameter to pass the session index, which is required to continue the authentication flow after receiving authentication response.
Identity provider initiated SSO