What is SAML? Security Assertion Markup Language, or SAML, is an open XML based standard for exchanging authentication and authorisation information between an identity provider and a service provider. It allows a user who has signed in once at their organisation to access external applications without creating separate passwords, which makes it a cornerstone of enterprise single sign-on and identity federation. SAML 2.0 is supported by almost every business application, from CRM and HR systems to collaboration tools. This guide explains how SAML works, the roles and flows involved, what an assertion contains, how SAML compares with OpenID Connect, common security risks and a practical approach to configuring SAML between your identity provider and applications.
Short answer: SAML lets an identity provider send a digitally signed XML assertion to an application, proving who the user is and which attributes they have, so the application can grant access without handling the password.
What is SAML?
The Security Assertion Markup Language article on Wikipedia describes it as an open standard for exchanging authentication and authorisation data between parties. It is the traditional protocol behind single sign-on and an alternative to OpenID Connect and OAuth. It supports zero trust access and is widely used in CRM platforms.
SAML roles and components

| Component | Role |
|---|---|
| Principal (user) | The person who wants access |
| Identity provider (IdP) | Authenticates the user and issues assertions |
| Service provider (SP) | The application that consumes assertions |
| Assertion | Signed XML statement about authentication, attributes and authorisation |
| Metadata | XML describing endpoints, certificates and identifiers |
| Assertion consumer service (ACS) | SP endpoint that receives the assertion |
| Binding | How messages travel, such as HTTP POST or Redirect |
SP initiated and IdP initiated flows
- The user opens the application, which creates a SAML authentication request.
- The browser is redirected to the identity provider with the request.
- The IdP authenticates the user, applying MFA and policy.
- The IdP builds a signed assertion with identifiers, validity times and attributes.
- The browser posts the assertion to the service provider ACS endpoint.
- The SP validates signature, issuer, audience and time conditions, then creates a session.
In an IdP initiated flow the user starts from a portal tile and the IdP sends the assertion without a prior request. It is convenient, but SP initiated flows are generally safer against some attacks because the request can be matched to the response.
What a SAML assertion contains
| Element | Purpose |
|---|---|
| Issuer | Identifies the IdP |
| Subject and NameID | Identifies the user |
| Conditions | Validity window and intended audience |
| AuthnStatement | How and when the user authenticated |
| AttributeStatement | User attributes such as email, groups and department |
| Signature | Proves integrity and origin |
SAML versus OpenID Connect
| Item | SAML 2.0 | OpenID Connect |
|---|---|---|
| Format | XML assertions | JSON Web Tokens |
| Typical clients | Browser based enterprise applications | Web, mobile, single page apps and APIs |
| Complexity | Heavier, metadata exchange | Lighter, discovery document |
| Maturity | Very established in enterprises | Newer, widely adopted |
| Mobile and API use | Limited | Strong |
Security risks and best practices
- Always validate signatures on assertions, and the response where required, using the IdP certificate.
- Check issuer, audience restriction, recipient and NotBefore and NotOnOrAfter times.
- Defend against XML signature wrapping by using well tested libraries.
- Prevent replay by tracking assertion identifiers and keeping lifetimes short.
- Plan certificate rotation, since expired signing certificates break sign in.
- Map attributes carefully and do not trust unsigned attributes for authorisation.
How to configure SAML SSO
- Collect metadata. Exchange IdP and SP metadata or enter entity IDs, endpoints and certificates.
- Define NameID and attributes. Agree on a stable user identifier and the attributes the application needs.
- Map groups to roles. Translate directory groups to application roles with least privilege.
- Test both flows. Verify SP initiated and, if required, IdP initiated sign in with test users.
- Enable provisioning and logout. Add SCIM provisioning and single logout where supported.
- Monitor and rotate. Track failures and calendar certificate renewals.
Our system integration service configures SAML and OIDC federation across your applications, and our CRM implementation service includes identity and role design for CRM platforms.
A worked example: SAML for a CRM rollout
A company rolls out a new CRM to 800 users and wants sign in through its corporate identity provider. The identity team creates a SAML application, exchanges metadata with the CRM, selects email as NameID and sends department and group attributes. Directory groups map to CRM roles such as sales representative, manager and administrator.
Testing reveals that the CRM rejects assertions because of clock skew on one server, which is fixed by time synchronisation. Provisioning is automated through SCIM, so leavers lose access immediately. The signing certificate renewal date is added to the operations calendar, avoiding an outage a year later.
Troubleshooting SAML problems
Most SAML failures come from a small set of causes: mismatched entity identifiers, wrong ACS URL, expired or rotated certificates, clock differences beyond the allowed window, missing attributes and unexpected NameID formats. Capture the SAML response with a browser tool or the IdP logs, decode it and compare the issuer, audience, conditions and attributes with the configuration. Keep a runbook of these checks so that support teams can resolve sign in issues in minutes.
Federation across organisations
SAML federation lets users from partner organisations access your applications with their own credentials. This avoids managing external passwords but needs agreements on identifiers, attributes, trust and liability. Use an identity broker or federation hub when many partners are involved, validate each partner metadata source, restrict access by role and log activity. Remove trust relationships when partnerships end, and review them regularly like any other privileged access.
SAML attributes and role mapping
| Attribute | Example | Use |
|---|---|---|
| NameID | a stable identifier or email | Links the assertion to one account |
| Email and name | name and mail values | Account creation and display |
| Groups or roles | sales-managers | Role assignment in the application |
| Department and region | finance, EMEA | Data access rules and routing |
| Employee identifier | HR number | Matching with other systems |
Choose a NameID that never changes, because renaming a user or reusing an email address can otherwise attach the wrong account to a person. Send only the attributes the application needs, to limit data exposure, and let the application handle missing attributes gracefully instead of failing the sign in.
Single logout and session management
Signing in is easy to design, and signing out is harder. SAML supports single logout, in which logging out of one application can end the session at the identity provider and others, but support is uneven and can leave sessions active in some apps. Combine it with sensible session lifetimes, re-authentication for sensitive actions and central session revocation when an account is disabled, so access really ends when it should.
Document which applications support single logout and which rely on session timeouts, and tell users clearly what signing out does. For shared devices and high risk roles, shorter sessions are a simple and effective safeguard.
Key takeaways
- SAML exchanges signed XML assertions between an identity provider and a service provider.
- It is the long standing standard for enterprise single sign-on and federation.
- Validate signatures, audience, conditions and replay protection on every assertion.
- OpenID Connect suits modern apps and APIs, while SAML remains common in enterprise software.
- Manage metadata, certificate rotation and attribute mapping carefully.
Quick glossary
| Term | Meaning |
|---|---|
| Assertion | A signed XML statement about a user |
| IdP | Identity provider that authenticates users |
| SP | Service provider that relies on assertions |
| ACS | Endpoint that receives assertions |
| Federation | Trust between organisations for shared sign in |
Read next: What Is API Management? Lifecycle, Features, Tools · What Is a Message Queue? Patterns and Best Practices · What Is RabbitMQ? Exchanges, Queues and Use Cases
Frequently asked questions
What is SAML in simple terms?
It is a standard that lets one system, the identity provider, vouch for a user to another application using a signed message, so the user does not need another password.
What is a SAML assertion?
It is a signed XML document containing statements about the user, such as identity, when they authenticated and attributes like email and groups.
What is the difference between SAML and OAuth?
SAML is used for authentication and federation with XML assertions. OAuth is for delegated access to resources with tokens.
What is the difference between SAML and OpenID Connect?
Both provide single sign-on. SAML uses XML and suits enterprise web apps, while OpenID Connect uses JSON tokens and suits modern web, mobile and APIs.
What is IdP initiated SSO?
The user starts at the identity provider portal and is sent to the application with an assertion, without the application sending a request first.
Why does SAML SSO fail?
Common causes are wrong entity IDs or URLs, expired certificates, clock skew, missing attributes and mismatched NameID formats.
Is SAML secure?
Yes, when signatures, audience and time conditions are validated and certificates are managed. Poor library use can expose signature wrapping and replay risks.
Do I still need SAML?
Many enterprise applications only support SAML for SSO, so it remains essential even as OpenID Connect grows.
