Overview
The SAML specification defines three roles: the principal (typically a human user), the identity provider (IdP) and the service provider (SP). In the primary use case addressed by SAML, the principal requests a service from the service provider. The service provider requests and obtains an authentication assertion from the identity provider. On the basis of this assertion, the service provider can make anHistory
Versions
SAML has undergone one minor and one major revision since 1.0. * SAML 1.0 was adopted as an OASIS Standard in November 2002 *Design
SAML is built upon a number of existing standards: * Extensible Markup Language (XML): Most SAML exchanges are expressed in a standardized dialect of XML, which is the root for the name SAML (Security Assertion Markup Language). * XML Schema (XSD): SAML assertions and protocols are specified (in part) using XML Schema. * XML Signature: BothAssertions
A SAML ''assertion'' contains a packet of security information:Assertion ''A'' was issued at time ''t'' by issuer ''R'' regarding subject ''S'' provided conditions ''C'' are valid.SAML assertions are usually transferred from identity providers to service providers. Assertions contain ''statements'' that service providers use to make access-control decisions. Three types of statements are provided by SAML: # Authentication statements # Attribute statements # Authorization decision statements ''Authentication statements'' assert to the service provider that the principal did indeed authenticate with the identity provider at a particular time using a particular method of authentication. Other information about the authenticated principal (called the ''authentication context'') may be disclosed in an authentication statement. An ''attribute statement'' asserts that a principal is associated with certain attributes. An ''attribute'' is simply a name–value pair. Relying parties use attributes to make access-control decisions. An ''authorization decision statement'' asserts that a principal is permitted to perform action ''A'' on resource ''R'' given evidence ''E''. The expressiveness of authorization decision statements in SAML is intentionally limited. More-advanced use cases are encouraged to use XACML instead.
Protocols
SAML Protocol Response A SAML ''protocol'' describes how certain SAML elements (including assertions) are packaged within SAML request and response elements, and gives the processing rules that SAML entities must follow when producing or consuming these elements. For the most part, a SAML protocol is a simple request-response protocol. The most important type of SAML protocol request is called a ''query''. A service provider makes a query directly to an identity provider over a secure back channel. Thus query messages are typically bound to SOAP. Corresponding to the three types of statements, there are three types of SAML queries: # Authentication query # Attribute query # Authorization decision query The result of an attribute query is a SAML response containing an assertion, which itself contains an attribute statement. See the SAML 2.0 topic for an example of attribute query/response. Beyond queries, SAML 1.1 specifies no other protocols. SAML 2.0 expands the notion of ''protocol'' considerably. The following protocols are described in detail in SAML 2.0 Core: * Assertion Query and Request Protocol * Authentication Request Protocol * Artifact Resolution Protocol * Name Identifier Management Protocol * Single Logout Protocol * Name Identifier Mapping Protocol Most of these protocols are new in SAML 2.0.Bindings
SAML over SOAP over HTTP A SAML ''binding'' is a mapping of a SAML protocol message onto standard messaging formats and/or communications protocols. For example, the SAML SOAP binding specifies how a SAML message is encapsulated in a SOAP envelope, which itself is bound to an HTTP message. SAML 1.1 specifies just one binding, the SAML SOAP Binding. In addition to SOAP, implicit in SAML 1.1 Web Browser SSO are the precursors of the HTTP POST Binding, the HTTP Redirect Binding, and the HTTP Artifact Binding. These are not defined explicitly, however, and are only used in conjunction with SAML 1.1 Web Browser SSO. The notion of binding is not fully developed until SAML 2.0. SAML 2.0 completely separates the binding concept from the underlying profile. In fact, there is a brand new binding specification in SAML 2.0 that defines the following standalone bindings: * SAML SOAP Binding (based on SOAP 1.1) * Reverse SOAP (PAOS) Binding * HTTP Redirect (GET) Binding * HTTP POST Binding * HTTP Artifact Binding * SAML URI Binding This reorganization provides tremendous flexibility: taking just Web Browser SSO alone as an example, a service provider can choose from four bindings (HTTP Redirect, HTTP POST and two flavors of HTTP Artifact), while the identity provider has three binding options (HTTP POST plus two forms of HTTP Artifact), for a total of twelve possible deployments of the SAML 2.0 Web Browser SSO Profile.Profiles
A SAML ''profile'' describes in detail how SAML assertions, protocols, and bindings combine to support a defined use case. The most important SAML profile is the Web Browser SSO Profile. SAML 1.1 specifies two forms of Web Browser SSO, the Browser/Artifact Profile and the Browser/POST Profile. The latter passes assertions ''by value'' whereas Browser/Artifact passes assertions ''by reference''. As a consequence, Browser/Artifact requires a back-channel SAML exchange over SOAP. In SAML 1.1, all flows begin with a request at the identity provider for simplicity. Proprietary extensions to the basic IdP-initiated flow have been proposed (by Shibboleth, for example). The Web Browser SSO Profile was completely refactored for SAML 2.0. Conceptually, SAML 1.1 Browser/Artifact and Browser/POST are special cases of SAML 2.0 Web Browser SSO. The latter is considerably more flexible than its SAML 1.1 counterpart due to the new "plug-and-play" binding design of SAML 2.0. Unlike previous versions, SAML 2.0 browser flows begin with a request at the service provider. This provides greater flexibility, but SP-initiated flows naturally give rise to the so-called ''Identity Provider Discovery'' problem, the focus of much research today. In addition to Web Browser SSO, SAML 2.0 introduces numerous new profiles: * SSO Profiles ** Web Browser SSO Profile ** Enhanced Client or Proxy (ECP) Profile ** Identity Provider Discovery Profile ** Single Logout Profile ** Name Identifier Management Profile * Artifact Resolution Profile * Assertion Query/Request Profile * Name Identifier Mapping Profile * SAML Attribute Profiles Aside from the SAML Web Browser SSO Profile, some important third-party profiles of SAML include: *Security
The SAML specifications recommend, and in some cases mandate, a variety of security mechanisms: *Use
The primary SAML use case is called ''Web Browser Single Sign-On (SSO)''. A user utilizes a ''user agent'' (usually a web browser) to request a web resource protected by a SAML ''service provider''. The service provider, wishing to know the identity of the requesting user, issues an authentication request to a SAML ''identity provider'' through the user agent. The resulting protocol flow is depicted in the following diagram. center, 600px, using SAML in a Web browser">Single sign-on using SAML in a Web browser ; 1. Request the target resource at the SP (SAML 2.0 only): The principal (via an HTTP user agent) requests a target resource at the service provider:The service provider performs a security check on behalf of the target resource. If a valid security context at the service provider already exists, skip steps 2–7. ; 2. Redirect to the SSO Service at the IdP (SAML 2.0 only):The service provider determines the user's preferred identity provider (by unspecified means) and redirects the user agent to the SSO Service at the identity provider:https://sp.example.com/myresource
The value of thehttps://idp.example.org/SAML2/SSO/Redirect?SAMLRequest=request
SAMLRequest
parameter (denoted by the placeholder request
above) is the Base64 encoding of a deflated
element.
; 3. Request the SSO Service at the IdP (SAML 2.0 only): The user agent issues a GET request to the SSO service at the URL from step 2. The SSO service processes the AuthnRequest
(sent via the SAMLRequest
URL query parameter) and performs a security check. If the user does not have a valid security context, the identity provider identifies the user (details omitted).
; 4. Respond with an XHTML form: The SSO service validates the request and responds with a document containing an XHTML form: SAMLResponse
element (denoted by the placeholder response
above) is the base64 encoding of a
element.
; 5. Request the Assertion Consumer Service at the SP: The user agent issues a POST request to the assertion consumer service at the service provider. The value of the SAMLResponse
parameter is taken from the XHTML form at step 4.
; 6. Redirect to the target resource: The assertion consumer service processes the response, creates a security context at the service provider and redirects the user agent to the target resource.
; 7. Request the target resource at the SP again: The user agent requests the target resource at the service provider (again): ; 8. Respond with requested resource: Since a security context exists, the service provider returns the resource to the user agent. In SAML 1.1, the flow begins with a request to the identity provider's inter-site transfer service at step 3. In the example flow above, all depicted exchanges are ''front-channel exchanges'', that is, an HTTP user agent (browser) communicates with a SAML entity at each step. In particular, there are no ''back-channel exchanges'' or direct communications between the service provider and the identity provider. Front-channel exchanges lead to simple protocol flows where all messages are passed ''by value'' using a simple HTTP binding (GET or POST). Indeed, the flow outlined in the previous section is sometimes called the ''Lightweight Web Browser SSO Profile''. Alternatively, for increased security or privacy, messages may be passed ''by reference''. For example, an identity provider may supply a reference to a SAML assertion (called an ''artifact'') instead of transmitting the assertion directly through the user agent. Subsequently, the service provider requests the actual assertion via a back channel. Such a back-channel exchange is specified as a SOAP message exchange (SAML over SOAP over HTTP). In general, any SAML exchange over a secure back channel is conducted as a SOAP message exchange. On the back channel, SAML specifies the use of SOAP 1.1. The use of SOAP as a binding mechanism is optional, however. Any given SAML deployment will choose whatever bindings are appropriate.https://sp.example.com/myresource
See also
* SAML metadata * SAML-based products and services * Identity management * Identity management systems * Federated identity * Information card * WS-Federation * OAuth * OpenID ConnectReferences
External links