data-driven-docs

Selft training repo


Project maintained by ggranados Hosted on GitHub Pages — Theme by mattgraham

Security Assertion Markup Language (SAML)


Table of Contents

SAML, or Security Assertion Markup Language, is an XML-based framework for exchanging authentication and authorization data between parties, primarily for the purpose of single sign-on (SSO) and identity federation. It allows different organizations or systems to share authentication and authorization information without the need for users to log in multiple times when accessing different applications or services.

Back to top

How SAML works

Parties Involved

Back to top

Authentication Flow

Back to top

SAML Benefits

SAML is widely used in enterprise environments, especially when different systems and services need to work together securely and efficiently. It provides a standardized way to establish trust and share authentication and authorization information between parties.

Back to top

Example

Simple example of a SAML assertion in XML format

<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_abc123" IssueInstant="2023-08-05T10:00:00Z" Version="2.0">

    <saml:Issuer>https://idpcorp.com</saml:Issuer>

    <saml:Subject>
        <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">alice@example.com</saml:NameID>
        <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
            <saml:SubjectConfirmationData NotOnOrAfter="2023-08-05T10:10:00Z"/></saml:SubjectConfirmation>
    </saml:Subject>

    <saml:Conditions NotBefore="2023-08-05T10:00:00Z" NotOnOrAfter="2023-08-05T10:10:00Z">
        <saml:AudienceRestriction>
            <saml:Audience>https://acmeapp.com</saml:Audience>
        </saml:AudienceRestriction>
    </saml:Conditions>
    
    <saml:AuthnStatement AuthnInstant="2023-08-05T10:05:00Z">
        <saml:AuthnContext>
            <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml:AuthnContextClassRef>
        </saml:AuthnContext>
    </saml:AuthnStatement>

</saml:Assertion>

Explanation of the XML elements in the SAML assertion:

This XML represents a basic SAML assertion that communicates the fact that the user (Alice) has been authenticated by the Identity Provider (https://idpcorp.com) and is authorized to access the Service Provider (https://acmeapp.com). It also includes information about the authentication method used and the validity period of the assertion.

In a real-world scenario, the SAML assertion would be included in the SAML response sent from the Identity Provider to the Service Provider during the authentication process. The SAML response would also include digital signatures and other metadata to ensure security and integrity.

Back to top


Ref.


Get Started | Web Services and API Design