skip to content

In SAML 2.0 web single sign-on, which party issues a SAML assertion and which party acts on it?

level: juniorimportance: must knowfreq 62%

answer

  1. two parties, one job each
  2. credentials stay on one side only
  3. issuer signs, consumer checks
  4. SingleSignOnService issues, AssertionConsumerService receives
  5. entityID names a party, not a person

basics

~10 s

The identity provider authenticates the person and issues a signed SAML assertion; the service provider receives it at its AssertionConsumerService endpoint and must validate it before creating its own application session.

solid answer

~40 s

There are two roles and each has one job. The **identity provider** holds the credentials, authenticates the person at its `<SingleSignOnService>` endpoint, and issues a signed `<saml:Assertion>` stating who authenticated and when. The **service provider** is the application the person was trying to reach; in this exchange it sees no credential at all. It receives the assertion at its `<AssertionConsumerService>` endpoint, validates it, and only then creates its own application session. Each party is named by an `entityID`, which is how a message can say who issued it and which party it is for. That split is also why the application sends you somewhere else to sign in: the application is not the thing that knows your password. Trusting the issuer does not remove the consumer's duty to validate.

code

xml · 6 lines
xml
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
                Destination="https://sp.example.net/saml/acs">
  <saml:Issuer>https://idp.example.com/idp</saml:Issuer>
  <!-- the signed <saml:Assertion> the service provider will validate -->
</samlp:Response>

go deeper

for a junior

Recall the split: one party authenticates the person and issues a signed statement, the other receives that statement and acts on it. The application you were trying to reach never handles your password in this exchange.

for a middle

Name the endpoints and say which party operates each — the sign-on service issues, the assertion consumer service consumes — and explain what validation the consuming side still owes even though it trusts the issuer.

for a senior

Show where the roles get swapped in real integrations: a consumer that reads a TLS connection as proof of who issued, or an issuer that delivers wherever the message asked. Name the consequence, not just the rule.

for a principal

Weigh what centralising authentication actually concentrates. One unreachable party stops sign-on estate-wide, and one signing key speaks for every application that trusts it. Say what fallback and what key-compromise plan you would fund.

## Two parties, one job each SAML 2.0 web single sign-on is a conversation between two kinds of party, with the person's browser carrying the messages between them. The **identity provider** is the party that holds authentication state for the person. It operates a `<SingleSignOnService>` endpoint, authenticates the person there by whatever means it chooses, and **issues** a signed `<saml:Assertion>`: an XML statement that a subject authenticated at a given instant, usually carrying attributes about that subject as well. Signing is what makes the statement usable by somebody else — it is the only reason a second party has to believe a document that arrives through an untrusted browser. The **service provider** is the application the person actually wanted. It **consumes** the statement. It operates an `<AssertionConsumerService>` endpoint, receives the assertion there, validates it, and creates its own local application session for the person. In this exchange it handles no password, no one-time code and no authenticator; it handles a signed document about somebody who proved themselves elsewhere. Each party is named by an **`entityID`** — a stable identifier for the organisation or deployment, not for a person. `entityID` is how the messages refer to the parties, and how each side looks up what it already knows about the other. ## Which endpoint belongs to which role | Role | Endpoint it operates | What it does | What it does not do | |---|---|---|---| | Identity provider | `<SingleSignOnService>` | authenticates the person, issues and signs the assertion | it does not run the application, and it does not decide what the person may do there | | Service provider | `<AssertionConsumerService>` | receives the assertion, validates it, starts a local session | it does not check credentials in this exchange, and it does not sign anything for the other side | | Attribute authority | described by `<AttributeAuthorityDescriptor>` | answers queries for attributes about a subject | it authenticates nobody and issues no authentication statement | The attribute authority is the third role the standard defines, and it is worth knowing because it is the counter-example that makes the other two precise: a party can make statements about a subject without ever having authenticated that subject. ## Why the application sends you somewhere else The redirect that surprises first-time readers is the whole point of the design: - credentials, password policy and any additional authentication factor live in **one** place, so they can be changed once; - the application stores no password, so a breach of the application does not leak one; - when somebody leaves, disabling them at the identity provider stops new sign-ons everywhere, without touching each application; - an application acquired through a business-to-business deal can be added to the estate without provisioning a second credential for every person. The cost sits on the same axis. Concentrating authentication concentrates failure: if the identity provider is unreachable nobody signs in anywhere, and its signing key speaks for every application that trusts it. That is a real trade-off, not a footnote. ## Trust does not remove the duty to validate The most common misreading of the role split is that a trusted issuer makes validation ceremonial. It does not. "The identity provider is trusted" is a statement about a **key**, not about whatever arrives at an endpoint. The assertion consumer service is reachable from the public internet, the browser is a hostile transport, and any party can post XML to it. Validation is how the consuming side establishes that this particular document came from the party it trusts, is addressed to it, and is still current. A consumer that skips it because the issuer is trusted has moved a security decision to a party that never made it. The mirror-image error sits on the issuing side: an identity provider that delivers a signed assertion to whatever location a request nominates has turned itself into a delivery service for credentials aimed at somebody else. ## Where the roles get swapped in practice Consider a port community: a carrier, a terminal operator and a customs broker all reading the same consignment documents, with one party authenticating the people and the rest accepting its word. The recurring failures are all role inversions: 1. the consuming side treats a TLS connection from the issuer's usual host as proof of who issued the statement — TLS authenticates a host, not a document; 2. the consuming side validates nothing because the issuer is trusted; 3. the issuing side posts to a delivery location it never established belonged to the party named in the message; 4. somebody reads `entityID` as if it named the person who signed in. ## One deployment can hold both roles The roles are per-exchange, not per-host. A single deployment can publish both an `<IDPSSODescriptor>` and an `<SPSSODescriptor>` under one `entityID`, consuming assertions from parties above it and issuing its own to parties below it. What must not blur is the duty: whichever direction a given message travels, the side receiving it still validates it.

  • Where does an attribute authority fit, given that the identity provider already sends attributes?
    It is a third role: a party that answers queries for attributes about a subject without authenticating anybody, described in a SAML metadata document by `<AttributeAuthorityDescriptor>`. In Web Browser SSO the identity provider normally carries attributes in the assertion it is already issuing, so a separate attribute authority appears mainly where attributes are wanted outside a sign-on.
  • Can one deployment be both an identity provider and a service provider?
    Yes — the roles are per-exchange. One entity can publish both an `<IDPSSODescriptor>` and an `<SPSSODescriptor>` under a single `entityID`, consuming assertions from upstream parties and issuing its own downstream. The duty does not move: whichever direction a message travels, the receiving side validates it.
  • If the service provider trusts the identity provider completely, why validate at all?
    Because the trust is in a signing key, not in an arriving HTTP request. The assertion consumer service endpoint is reachable by anyone, and the browser that delivers the message is not a trusted channel. Validation is how the consuming side establishes that this document really came from that key, is addressed to it, and is still within its validity window.

At a port gate, the harbour authority issues the pass and the terminal gate reads it; the gate never holds the driver's identity documents. It still inspects the pass rather than waving through anyone who arrives from the authority's direction.

saying these in an interview costs you the question

  • Says the service provider checks the user's password itself.
  • Treats a trusted issuer as a reason to skip validating the assertion.
  • Uses entityID as though it identified the person signing in.
  • Says single sign-on means the same password typed into every application.
  • Claims the identity provider decides what the person may do in the application.