When employees access multiple enterprise applications, managing separate credentials and authentication processes can become challenging for IT teams. Organizations need a way to centralize authentication without requiring users to sign in separately to every application.
SAML (Security Assertion Markup Language) is an XML-based federation standard commonly used for browser-based single sign-on (SSO). In a typical SAML 2.0 login, an identity provider authenticates the user and sends the application a SAML response containing an assertion. The application verifies the required signature and other conditions before creating its own session.
For IT and identity administrators, understanding how SAML works helps them determine when to use it, configure trust relationships correctly, and distinguish authentication failures from account or permission problems.
Key Takeaways
- SAML is an XML-based standard that enables federated authentication and single sign-on across compatible applications.
- SAML SSO uses an identity provider (IdP) to authenticate users and a service provider (SP) to validate assertions.
- SAML supports SP-initiated and IdP-initiated login flows, each with different security considerations.
- Secure SAML implementation requires assertion validation, trusted configurations, and certificate management. SAML does not automatically handle application authorization or provisioning.

What is SAML?
SAML allows two organizations or systems to exchange authentication information without sharing the user’s application password. It establishes a trust relationship between:
- An identity provider (IdP) that authenticates the user
- A service provider (SP) that operates the application the user wants to access
The IdP issues an XML document called a SAML assertion. The assertion can identify the user, describe how or when authentication occurred, and carry attributes such as an email address, department, or group membership. The SP relies on the assertion only after checking that it came from a trusted IdP and is valid for that application and login attempt.
This arrangement is a form of identity federation: the application delegates authentication to an external identity authority. It can give users access to multiple applications after signing in through the IdP, although each application still creates and manages its own session.
SAML 2.0 is the version used for the browser SSO flows described here. SAML can convey identity and authentication information, but it does not define a universal application-permission model.
Who and what participate in a SAML login?
User, browser, identity provider, and service provider
Four participants are central to a SAML browser login:
- User: The person trying to open an application.
- Browser: The intermediary that carries SAML requests and responses between the IdP and SP. The browser usually transports the messages through redirects and form submissions.
- Identity provider: The system that authenticates the user. It may check a password, certificate, security key, or another factor, or recognize an existing IdP session.
- Service provider: The application that consumes the SAML result. After validating it, the SP decides whether to create an application session and what the user may access.
The IdP does not normally send the user’s password to the SP. Instead, it sends a signed statement that the SP can verify under their preconfigured trust relationship.
AuthnRequest, response, assertion, and application session
Several related artifacts appear during the login process:
- AuthnRequest: A message from the SP asking the IdP to authenticate a user. It can include the SP’s identity, return location, and requested authentication context.
- SAML response: The IdP’s protocol response to the SP. It reports success or failure and, for a successful login, typically contains an assertion.
- SAML assertion: A time-limited statement issued by the IdP about the user. It can contain an authentication statement, attributes, and restrictions defining where and when it may be accepted.
- Application session: The SP’s own logged-in session, often represented by a secure application cookie. It is separate from the assertion and from the user’s session at the IdP.
A SAML assertion is not intended to serve as a permanent application session. The SP validates it, consumes it, and then applies its own session controls.
How does SAML single sign-on work?
How SP-initiated SAML SSO works
In service provider-initiated SSO, the user begins at the application:
- The user opens the application. The SP finds no valid local application session.
- The SP creates an AuthnRequest. It redirects the browser to the IdP, commonly using the HTTP-Redirect binding.
- The IdP authenticates the user. The IdP may prompt for credentials and multifactor authentication, or it may recognize an existing IdP session.
- The IdP creates a SAML response. The response typically contains an assertion identifying the user and describing the authentication event.
- The browser submits the response to the SP. This commonly happens through an auto-submitted HTML form sent to the SP’s Assertion Consumer Service (ACS) URL.
- The SP validates the response and assertion. It checks the required signature, configured trust relationship, intended audience and destination, validity period, and request correlation.
- The SP creates an application session. The user is redirected to the requested resource, subject to the application’s account and authorization rules.

The browser transports the messages, but the trust decision belongs to the SP. The OASIS SAML technical overview describes this relationship between the asserting IdP and relying SP.
How IdP-initiated SAML SSO works
In an identity provider-initiated flow, the user starts from an IdP portal or application catalog. The IdP sends the browser to the SP with an unsolicited SAML response; the SP did not first send an AuthnRequest.
Because there is no original request, an unsolicited response generally has no request identifier for the SP to match through InResponseTo. The SP must explicitly support IdP-initiated SSO and still validate the signature, issuer, audience, destination, recipient, and time restrictions. It must not treat the absence of request correlation as permission to skip the remaining checks.
SP-initiated login provides stronger request context and is often easier to correlate with the user’s intended destination. IdP-initiated login can still be useful for application portals, but it should be enabled only when the SP supports the pattern securely. The distinction is defined in the SAML 2.0 Web Browser SSO Profile.
How is a SAML assertion validated?
Signatures, issuer, audience, destination, and time conditions
Receiving well-formed XML is not enough. The SP must compare the response and assertion with its preconfigured trust and the context of the login.
Important checks include:
- Signature and signing key: Verify the required response or assertion signature using the trusted IdP certificate. The implementation must also defend against XML signature-wrapping and related parsing attacks.
- Issuer: Confirm that the assertion identifies the expected IdP entity.
- Audience: Confirm that the assertion was issued for this SP, usually by comparing the audience with the SP’s entity ID.
- Destination and recipient: Confirm that the response and bearer assertion target the expected ACS endpoint.
- Time conditions: Enforce NotBefore and NotOnOrAfter restrictions, with only a controlled allowance for clock differences.
- Request correlation: For SP-initiated login, verify that InResponseTo matches an outstanding request and reject unexpected or replayed responses.
- Status and subject confirmation: Accept only a successful response whose subject-confirmation method and data meet the SP’s expectations.
Trust is normally established by exchanging SAML metadata or configuring equivalent values through a protected administrative process. Metadata can communicate entity IDs, endpoints, bindings, and certificates, but administrators still need procedures for validating changes and rotating certificates.
SAML endpoints should use TLS, and the SP must use a security-reviewed XML and signature-validation implementation. The OWASP SAML Security Cheat Sheet provides implementation-focused guidance for these checks.
What SAML authentication does not determine about application permissions
A valid assertion answers an authentication question: can the SP trust the IdP’s statement about this user? It does not automatically decide what the user can do inside the application.
An assertion may contain group, department, role, or entitlement attributes. The SP can map those values to local roles, but its own authorization policy determines whether a value grants access. The same group attribute may produce different permissions in different applications.
Account state also matters. An SP may reject a correctly authenticated user because the corresponding account is disabled, unlicensed, missing, or not assigned to the application.
When should an organization use SAML?
Benefits and limitations for workforce web applications
SAML is a strong fit when an organization needs centralized authentication for enterprise web applications that already support SAML 2.0. Common examples include SaaS administration consoles and internal browser-based applications.
Its practical benefits include:
- Users authenticate through the organization’s IdP instead of maintaining a separate password for every application.
- The organization can apply central authentication controls, including the IdP’s multifactor authentication policies.
- Applications can receive consistent user identifiers and approved attributes.
- SAML has broad support across established enterprise web applications and identity platforms.
SAML also brings operational costs. XML messages and signature processing are complex, integrations can be sensitive to exact URLs and identifiers, and signing certificates require lifecycle management. Its browser-oriented design is often less natural for native mobile sign-in and API authorization than newer token-based protocols.
The correct choice still depends on what the application supports. Replacing a stable SAML integration with another protocol solely because it is newer may provide little practical value.
SAML vs. OpenID Connect vs. OAuth
SAML, OpenID Connect, and OAuth solve related but different problems:
| Requirement | Common protocol choice | What it provides |
|---|---|---|
| Enterprise browser SSO to an existing SaaS or internal web application | SAML 2.0 | Federated authentication through XML assertions |
| Sign-in for modern web, single-page, native, or mobile applications | OpenID Connect (OIDC) | An authentication layer built on OAuth 2.0, including ID Tokens and identity claims |
| Delegated access to an API or protected resource | OAuth 2.0 | Access tokens representing delegated authorization |
OpenID Connect standardizes authentication on top of OAuth 2.0. OAuth 2.0 is primarily an authorization framework; by itself, it does not define a standard user-authentication result equivalent to an OIDC ID Token or SAML assertion.
These are architectural guidelines rather than absolute platform rules. Application support, client type, security requirements, and existing identity infrastructure should drive the decision. For a deeper comparison, explore our SAML vs. OIDC and SAML vs. OAuth guide.
What should you check when configuring SAML SSO?
Exchange metadata, entity IDs, ACS URL, and signing certificate
Before enabling SAML for users, compare the IdP and SP configuration values carefully:
- Entity IDs: Confirm the exact identifiers for both the IdP and SP. An entity ID is an identifier, even when it resembles a URL; it is not necessarily a browser destination.
- ACS URL: Enter the precise endpoint where the SP accepts SAML responses. Check scheme, hostname, path, port, and trailing-slash requirements.
- SSO URL: Configure the IdP endpoint to which the SP sends authentication requests.
- Signing certificate: Install the correct IdP verification certificate at the SP and document how certificate rotation will work.
- Signing expectations: Determine whether the SP requires the response, assertion, or both to be signed.
- Bindings: Confirm the expected binding for requests and responses, such as HTTP-Redirect or HTTP-POST.
- Environment: Keep test and production entity IDs, ACS URLs, and certificates separate.
- Logout values: Configure Single Logout only if both systems support the intended profile and session behavior.
Do not assume that importing metadata eliminates the need to review these values. Metadata must come from an authenticated source, and administrators should understand how updates and certificate rollover are handled.
Map the user identifier and attributes, then test a login
Choose the identifier the application will use to match the assertion to an account. Depending on the SP, this may be a NameID, email address, username, or stable internal identifier. When the application supports it, a stable identifier can make account matching more reliable than a value such as an email address that may change. Confirm how the SP handles identifier changes before deployment.
Then verify:
- The NameID format and value expected by the SP
- Required attribute names, formats, and capitalization
- Group-to-role mappings, if the application supports them
- Whether an account must already exist or can be created just in time
- Whether IdP multifactor authentication behaves as intended
- What happens when a user is disabled or unassigned
Test with a normal user before enforcing SAML across the organization. Keep a documented break-glass administrator path that does not depend on the new integration, where the application supports one. Also test certificate rollover and failure recovery rather than waiting for a production certificate to expire.
How do you troubleshoot a failed SAML login?
Before troubleshooting a failed SAML login, identify whether the issue occurs during IdP authentication, SAML response validation, or application access.
Start with logs from both the IdP and SP. The IdP can show whether authentication and response issuance succeeded; the SP can show why it rejected the response or denied application access.
| Symptom | Checks to perform |
|---|---|
| Invalid signature or untrusted certificate | Confirm the SP has the correct IdP certificate, the expected message element is signed, and the certificate has not expired or been rotated unexpectedly. |
| Audience validation failed | Compare the assertion audience with the SP entity ID, including case, scheme, path, and trailing characters. |
| Destination or recipient mismatch | Compare the response destination and subject recipient with the exact ACS URL receiving the message. Check for test-versus-production URLs. |
| User not found | Inspect the NameID value and format. Confirm that the application matches it to the intended local account field. |
| Required attribute missing | Check the IdP attribute mapping, exact attribute name, value format, and whether the test user has a source value. |
| Assertion expired or not yet valid | Synchronize system clocks and inspect NotBefore and NotOnOrAfter. Avoid hiding significant time drift by allowing an excessive clock-skew window. |
| InResponseTo or request-correlation error | Confirm that the response matches an active SP request and that proxies, browser retries, or duplicate submissions are not disrupting the flow. |
| SAML succeeds but access is denied | Review account status, application assignment, licensing, and local role or group mappings. This is usually an authorization or account-lifecycle issue rather than failed authentication. |
| Login repeatedly returns to the IdP | Check whether the SP successfully creates and retains its session cookie, including cookie domain, SameSite, secure-transport, and browser restrictions. |
SAML responses can contain personal data and bearer assertions that are sensitive while valid. Avoid pasting complete responses into unsecured tickets, chat tools, or public decoders. If message inspection is necessary, use an approved diagnostic process and redact sensitive values before sharing them.
Simplify enterprise authentication with SAML SSO
SAML remains an established standard for enabling single sign-on across enterprise applications. By allowing trusted identity providers to authenticate users, it helps organizations centralize authentication while leaving application-specific access decisions to individual service providers. Successful implementation depends on correctly configuring trust relationships, validating assertions, managing certificates, and testing authentication flows. Solutions such as Scalefusion OneIdP support SAML-based SSO for compatible applications, helping IT teams put these principles into practice.
Explore Scalefusion OneIdP
FAQs
1. What does SAML stand for, and is SAML 2.0 the current version?
SAML stands for Security Assertion Markup Language. SAML 2.0 is the current OASIS specification version used for the browser SSO flows discussed in this article, together with its published errata.
2. Does SAML SSO create a user account in an application?
Not by itself. SAML authenticates the user and can provide identity attributes. The application may require a pre-existing account, create one through just-in-time provisioning, or receive accounts through a separate provisioning process.
3. Does signing a SAML assertion encrypt its contents?
No. A signature allows the SP to verify the assertion’s integrity and signer; it does not hide the contents. Encryption is a separate protection that must be configured and supported by the IdP and SP. HTTPS/TLS protects browser-to-endpoint transport in transit; it does not encrypt assertion contents once they are received or otherwise exposed at an endpoint.
4. Does signing out of one SAML application sign you out of every application?
Not necessarily. Signing out usually ends only that application’s session. The IdP session and sessions at other applications may remain active unless the IdP and participating SPs support and successfully complete coordinated SAML Single Logout.

