The SAML Protocol: exchanging authentication and authorization between parties
The Security Assertion Markup Language (SAML) is an XML-based standard for exchanging authentication and authorization data between…
The Security Assertion Markup Language (SAML) is an XML-based standard for exchanging authentication and authorization data between parties, primarily between an identity provider (IdP) and a service provider (SP).
SAML was developed by the Organization for the Advancement of Structured Information Standards (OASIS) and has become a widely adopted standard for Single Sign-On (SSO) and identity federation.
Components of SAML
- Assertions: Assertions are the core of SAML, as they contain the information needed for authentication and authorization. There are three types of assertions:
a. Authentication Assertion: Confirms the user’s identity.
b. Attribute Assertion: Contains additional user attributes, like name, email, or role.
c. Authorization Decision Assertion: Grants or denies access to specific resources. - Protocol: SAML protocol defines the rules for requesting and exchanging assertions between parties. The most common protocol is the SAML 2.0 Web Browser Single Sign-On (SSO) Profile, which allows users to log in to multiple web applications with a single set of credentials.
- Bindings: Bindings define the communication mechanism between the IdP and SP, dictating how SAML messages are transported between them. Common bindings include HTTP POST, HTTP Redirect, and SOAP.
The SAML process involves four main steps:
- Service Provider (SP) Initiated SSO:
a. The user attempts to access a protected resource on the service provider’s website.
b. The service provider generates a SAML AuthnRequest and sends it to the user’s browser via an HTTP Redirect or POST binding.
c. The user’s browser forwards the AuthnRequest to the identity provider (IdP). - Identity Provider (IdP) Authentication:
a. The IdP verifies the user’s identity by checking an existing session or prompting the user to enter their credentials.
b. Once authenticated, the IdP generates a SAML Assertion containing the user’s authentication and attribute information. - Assertion Transmission:
a. The IdP sends the SAML Assertion back to the user’s browser, typically using an HTTP POST binding.
b. The user’s browser forwards the Assertion to the service provider. - Service Provider (SP) Validation:
a. The service provider validates the Assertion, checking the digital signature and ensuring it is from a trusted IdP.
b. If the validation is successful, the user is granted access to the protected resource.
Benefits of SAML
- Single Sign-On (SSO): SAML enables users to log in to multiple web applications with a single set of credentials, reducing the need for multiple usernames and passwords.
- Improved Security: SAML reduces the risk of phishing and password-related attacks, as user credentials are not directly sent to the service provider.
- Simplified User Management: SAML allows organizations to centralize user management, streamlining administration and reducing the risk of unauthorized access.
- Interoperability: SAML is a widely supported standard, enabling organizations to integrate easily with various identity providers and service providers.
Follow me on Medium, LinkedIn, and Twitter.
All the best,
Luis Soares
CTO | Head of Engineering | Cyber Security | Blockchain Engineer | NFT | Web3 | DeFi | Data Scientist
#applicationsecurity #security #identity #identitymanagement #accesscontrol #cyber #cybersecurity #cyberattack #threat #security #devsecops #prevention