How SAML sign-in works
Cedar Inc. signs its staff in once, and its outside services trust Cedar's word about who has signed in. SAML carries that word as a signed XML statement through the employee's browser, and each service turns it into a sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier. of its own.
An application that does not know your password
Cedar Inc. buys an online training service for its staff. On her first morning with it, Avery clicks the link in her welcome email, and instead of a new sign-up form she sees Cedar Inc.'s familiar sign-in page. She signs in as she does every day, and a moment later she is looking at her assigned courses on training.example. The training company never asked for her password, and it does not have one.
That arrangement is what Cedar Inc. wanted. With hundreds of employees, a separate password at every outside service would mean hundreds of extra passwords to forget, reuse and reset, and a former employee would keep each of them until someone remembered to delete the account. Instead, Cedar Inc. keeps sign-in in one place and tells the training service who has signed in. Trust across systems introduced this idea as federationAn arrangement that lets systems accept identity information from another trusted system, so an application can rely on a sign-in performed by a separate identity provider.. SAML, the Security Assertion Markup Language, is one of the standards that carries it out, and it remains the most common way companies connect their staff to business applications.
The training service still has its own accounts, courses and permissions. What it gives up is checking credentials. It relies on Cedar Inc.'s statement that Avery has just signed in, and that statement has to be trustworthy enough to open her account.
Two parties and an agreement
SAML names the two sides by their jobs. Cedar Inc. is the identity provider, or IdP: it authenticates people and makes statements about them. The training service is the service provider, or SP: it receives those statements and decides what to do with them.
Before Avery's first sign-in, the two organizations exchange a few public facts. Each has an entity ID, a unique name for itself written as a URI. Cedar Inc.'s is https://login.cedar.example and the training service's is https://training.example/saml. An entity ID only has to be unique; it need not be a web page anyone can open.
The training service also names its assertion consumer service, or ACS, the address where it accepts sign-in results: https://training.example/saml/acs. Cedar Inc. names the address where it accepts sign-in requests, https://login.cedar.example/saml/sso, and publishes the certificateA signed statement that a public key belongs to a name, such as a website's hostname, for stated purposes and a limited period. A certificate authority signs it, so software that trusts the authority can connect the key to the name. holding the public keyThe half of a key pair that can be shared freely. It checks signatures made with the matching private key and can encrypt data that only that private key can decrypt. it signs with. These facts usually travel as XML documents called metadata, which Metadata, certificates, and key rollover looks at closely.
The agreement is the foundation for everything that follows. When a message arrives, each side compares it with what it already knows about the other: who should be speaking, to whom, at which address and signed with which key. A message from a provider the training service has no agreement with is not trusted, however much it looks like SAML.
Following Avery through the browser
Here is the whole sign-in, step by step. Avery opens https://training.example/courses. The training service has no session for her browser, so it builds an authentication request, saves a note that this browser is waiting for an answer to it, and sends the browser to Cedar Inc. with the request attached. Stripped to its essentials, the request reads:
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_a7f3c2e91b0d" Version="2.0" IssueInstant="2026-10-12T08:59:58Z"
Destination="https://login.cedar.example/saml/sso"
AssertionConsumerServiceURL="https://training.example/saml/acs">
<saml:Issuer>https://training.example/saml</saml:Issuer>
</samlp:AuthnRequest>In plain words: "This is the training service. Please authenticate whoever is using this browser, and send the answer to my ACS." The ID lets the training service recognize the answer when it comes back.
Cedar Inc. receives the request, looks up the issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. in its own agreements, and confirms that the ACS address belongs to the training service. If the request asked for the answer to go anywhere else, Cedar Inc. would refuse before Avery even signed in, because a signed statement delivered to the wrong address could be used there. Avery signs in, or, if she already has a session with Cedar Inc. from earlier that morning, Cedar Inc. reuses it without asking again. That reuse is the "single" in single sign-onSigning in once and then using several applications without entering credentials again, usually because they all rely on the same identity provider..
Cedar Inc. then builds a response containing an assertion, a statement signed with an XML signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message., the kind XML and XML signatures for identity took apart, that says, in effect: "Cedar Inc. authenticated this person at 08:55; for the training service she is cedar-training-742; this statement is valid for five minutes and only at the training service's ACS." It cannot send the response to the training service directly, because the browser is the only party talking to both. So it gives the browser an HTML page with a form holding the response, and the page submits the form to the ACS by itself.
Both messages crossed the browser. That path is the front channel from How applications communicate, and it is why SAML assumes the browser and anything running in it can read, delay, copy or replay messages. The browser is a courier, not a source of authority, and every protection SAML relies on is inside the messages themselves.
A statement becomes a local session
When the form arrives at https://training.example/saml/acs, the training service validates it against the agreement and its saved note. Is it signed with Cedar Inc.'s key? Is it addressed to the training service, at this ACS? Is it inside its five minutes? Does it answer the request this browser started? Has this exact assertion been used before? Validating a response goes through the checks in order. Seeing Avery's name in the XML is not one of them.
Once the response passes, the training service finds the local account linked to cedar-training-742 and creates its own session for Avery, usually a cookieA small value that a website asks the browser to store and send back with later matching requests. Cookies commonly carry a session identifier, so the site can recognize an ongoing sign-in without your password. on training.example. From then on it recognizes her by that cookie. Cedar Inc.'s session cookie stays on login.cedar.example, and the training service never sees it. SAML handed over a sign-in result, not a shared session and not Avery's password.
Two sessions now exist, one at each service, and they live separate lives. Avery could sign out of the training service and still be signed in at Cedar Inc., so the next application she opens would not ask for her password at all.
What the sign-in does not decide
Authentication tells the training service who Avery is. It does not decide what she may do there. If the managers' leadership course is restricted, the training service checks its own permissions, perhaps using a department attribute Cedar Inc. agreed to send. A valid assertion opens Avery's account, not every course.
The sign-in also does not tie the two sessions together. When Avery's employment ends, disabling her at Cedar Inc. stops new sign-ins everywhere at once, which is one of federation's great advantages, but a session the training service already created lasts until it expires or is ended. Coordinated sign-out is a separate exchange, covered in Single logout.
The request and response in this lesson traveled as a redirect and an auto-submitted form. Those are two of SAML's bindings, the rules for carrying a SAML message over HTTPThe Hypertext Transfer Protocol, the rules browsers, apps, and servers use to send requests and responses on the web., and they decide how messages are encoded and how they are signed.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Follow a SAML sign-in between your two lab tenantsSign in to Lab Mail through Lab Photos with SAML, see which service gets the password, watch Lab Photos refuse an unregistered ACS, and keep the two sessions apart.