skip to content

Federated identity

14 roadmaps177 questionsupdated

Delegated authorization with OAuth2, ID tokens and claim sets in OpenID Connect, signed JWTs, SAML assertions and cross-organisation trust. Interviewers probe whether you can federate a login safely.

on this pageshow

guide

overview

~1 min

Federated identity is the subject behind "Sign in with…" buttons, enterprise single sign-on integrations and APIs that accept a token it did not issue. Interviewers use it to test one habit above all: whether you can say exactly which party is trusting which statement, for what, and on what evidence. A login flow that skips one of those checks is a vulnerability, not a style issue. The hub splits into five sections. [OAuth2](/topics/proto-oauth2) is the delegation framework: the parties involved, the flows a client chooses between, the lifecycle of the tokens it receives, and the attacks the framework has accumulated defences against. [OpenID Connect](/topics/proto-oidc) layers authentication on top, adding a token that describes a sign-in rather than a permission. [JWT](/topics/proto-jwt) is the token format both of those commonly use, and the section on what a verifier owes a token before trusting it. [SAML](/topics/proto-saml) is the older XML standard that enterprise and B2B integrations still arrive in. [Federation patterns](/topics/proto-federation) widens the view to estates with many organisations, where trust comes from a shared anchor and identity strength has to be graded rather than assumed. Start with OAuth2's roles and flows, because OpenID Connect only makes sense as an extension of them. Learn JWT structure and validation next, since the ID token is a JWT and most token bugs are validation bugs. Take SAML once the vocabulary of issuers, audiences and signed assertions is familiar, and leave multilateral federation for last. Questions run from a junior naming the four OAuth2 roles to a principal designing a years-long migration between standards; the same concepts return at every depth.

primer

### Authorization is not authentication OAuth2 answers "may this client act on this resource?" and deliberately says nothing about who is at the keyboard. OpenID Connect and SAML answer "who signed in, where, and when?". Interviewers return to it often because systems built on the confusion accept an access token as proof of a login, and a token that was never meant to identify anyone ends up doing so. ### Every token is a statement with a sender and an addressee An access token, an ID token and a SAML assertion are each a claim issued by one party for a named recipient. Most validation rules exist to confirm both ends: the issuer is the one you configured, the audience is you, and the statement is still inside its time window. A statement addressed to someone else is not yours to act on, however valid its signature. ### A signature proves origin and integrity, nothing more Signing tells you who minted a token and that nobody changed it. It does not hide the contents, does not prove the token was meant for you, and does not prove it is still wanted. Confidentiality needs encryption; relevance needs the audience and time checks; withdrawal needs state somewhere. ### The browser is an untrusted courier Redirect-based flows move codes, assertions and responses through a user agent the attacker may influence. That is why flows prefer a short-lived code exchanged on a back channel, why redirect targets are registered in advance, and why clients bind each request to the response that answers it. Much of the attack-surface material is about what breaks when one binding is loose. ### Trust is configured before any user arrives Keys, endpoints, issuer identifiers and supported formats are exchanged ahead of time through metadata, discovery documents or a federation's trust chain. At login time the relying side only checks the incoming statement against that configuration. A login flow is only as sound as the way its trust material was obtained and refreshed. ### Verifier configuration outranks token contents A token's header can name an algorithm or a key, but the verifier decides what it accepts. Several of the best-known token attacks work only because a verifier let the token choose how it would be checked.

Resource owner
The person or entity able to grant access to a protected resource; in most web flows, the end user whose account a client wants to reach.
Authorization server
The OAuth2 party that authenticates the resource owner, obtains consent and issues tokens to clients.
Relying party
The application that accepts an identity statement from a provider instead of authenticating the user itself; the OpenID Connect name for an OAuth2 client doing sign-in.
Identity provider
The party that authenticates users and issues identity assertions about them; called an OpenID Provider in OpenID Connect.
Service provider
In SAML, the application that consumes assertions from an identity provider and creates its own session from them.
Access token
A credential a client presents to a resource server to exercise a granted scope; it is not a statement about who signed in.
Refresh token
A longer-lived credential a client sends only to the authorization server to obtain new access tokens without involving the user again.
ID token
The OpenID Connect token, always a JWT, that records an authentication event for one client: issuer, subject, audience and timing.
Scope
A string naming a range of access a client requests; the authorization server defines what each value means and may grant less than asked.
Grant type
The method by which a client obtains a token, chosen by who is present and what the client can protect.
Audience
The intended recipient of a token or assertion; a verifier that is not named should refuse to rely on it.
JWKS
A JSON document listing an issuer's public keys, fetched by verifiers to check token signatures and to follow key rotation.
Assertion
A signed statement an identity provider makes about a subject; in SAML, the XML element carrying authentication and attribute information.
Binding
In SAML, the rule for carrying a protocol message over a transport, such as a browser redirect or an auto-submitted form.
Trust anchor
A party every federation member already trusts, whose signed statements vouch for other members so they need no pairwise agreements.
Level of assurance
A graded statement about how strongly a user's identity was proofed and authenticated, interpreted under a named trust framework.

The five sections stack rather than sit side by side, and most interview discussions cross at least two of them. ### OAuth2 is the base layer OAuth2 supplies the parties, the redirect-and-exchange choreography and the token endpoint. OpenID Connect reuses all of it: a sign-in is an OAuth2 authorization request with an extra scope value, and it returns an ID token beside the access token. If you can draw the OAuth2 [delegation flows](/topics/proto-oauth2-grants), the [OpenID Connect flows and metadata](/topics/proto-oidc-operations) section reads as a set of deltas. ### JWT is the shared envelope Access tokens can be opaque strings or JWTs, depending on the authorization server; ID tokens are JWTs by definition. Federation statements in the newer multilateral schemes are JWTs too. That is why [token validation](/topics/proto-jwt-validation) sits at the centre of the hub: the same signature, issuer, audience and expiry checks recur whenever a party receives a token from another. ### SAML solves the same problem in a different format SAML predates OpenID Connect and covers the same ground, browser single sign-on between an identity provider and an application, with XML assertions, XML signatures and its own bindings and metadata. Much of what you learn for one transfers: issuer and audience checks, time windows, request-to-response binding, published keys. What does not transfer is the XML signature processing, which has its own class of attacks. ### Federation patterns sit above the protocols Once more than two organisations are involved, the questions shift from message formats to governance: who vouches for whom, how metadata is filtered by a superior, which standard each member should speak, and how to compare identity strength between partners. The [standard selection](/topics/proto-federation-protocol-choice) section is where OpenID Connect and SAML meet head on.

  1. Core Framework →

    The four parties and their responsibilities are the vocabulary every other section assumes, OpenID Connect and SAML included.

  2. Delegation Flows →

    Which flow fits which caller, and why the authorization code with a back-channel exchange became the default for interactive sign-in.

  3. Token Structure →

    Most tokens you will validate are JWTs; know what the three parts carry and what anyone holding one can read.

  4. Token Validation →

    The checks a verifier owes a token, in order; skipping one is the root of most token bugs interviewers probe.

  5. Assertion Format →

    The ID token and its claims turn OAuth2 delegation into sign-in; this is where authentication finally enters.

  6. SP- and IdP-Initiated SSO →

    With issuers and audiences familiar, SAML's two login directions show the same ideas in the enterprise format.

  • Treating an OAuth2 access token as proof of who signed in; authentication needs an ID token or an assertion addressed to your application.

  • Checking a token's signature and stopping there, without confirming issuer, audience and expiry; a genuine token minted for another client still passes the signature check.

  • Letting the token's header choose the verification algorithm or key instead of pinning them in verifier configuration.

  • Putting personal data or secrets in a signed JWT payload on the assumption that signing hides it.

  • Registering redirect URIs with wildcards or prefix matching, which hands authorization codes to any destination an attacker can reach.

  • Omitting state or PKCE from an authorization-code flow because the happy path works without them.

  • Promising instant revocation for self-contained tokens without naming the server-side state or short lifetime that would make it possible.

  • Accepting unsolicited SAML responses by default, or verifying an XML signature without confirming it covers the element the application actually reads.

  • Comparing assurance levels from two partners as if identical labels meant the same thing under different trust frameworks.

The same handful of choices recur throughout the hub, and naming the one you are making is usually what an interviewer is listening for. - **Self-contained versus opaque tokens.** A JWT can be checked locally with a public key, which removes a network call per request, but it keeps working until it expires. An opaque token needs introspection or a shared store, and in exchange can be withdrawn at once. - **Token lifetime versus revocation latency.** Short access tokens limit the damage of a leak and push work onto refresh; long ones reduce traffic and widen the window. Revocation usually happens at the refresh token. - **Shared-secret versus asymmetric signing.** A symmetric key is simple and fast, but every verifier can also mint tokens. Asymmetric keys separate issuing from verifying at the cost of key distribution and rotation. - **Front-channel versus back-channel delivery.** The browser is convenient and needs no direct connectivity between parties, but it is observable and unreliable; server-to-server calls are harder to set up and far easier to trust. - **SAML versus OpenID Connect.** The partner often decides. When you have the choice, weigh your team's tooling for XML signatures against JSON-based tokens, and the clients you must support beyond the browser. - **Pairwise agreements versus a federation.** Two partners can exchange metadata directly; dozens need a trust anchor and its governance.

A few shapes appear across all five sections under different names; recognising them makes an unfamiliar question easier to place. - **Redirect out, come back with a proof.** OAuth2 authorization requests, OpenID Connect sign-in and SAML's service-provider-initiated login all send the browser to the party that holds the credential and bring back something short-lived to be checked. - **Bind the answer to the question.** `state`, `nonce`, PKCE's verifier and SAML's request identifier all tie a response to the specific request that asked for it, so an injected or replayed response is rejected. - **Check who sent it, who it is for, and when.** Issuer, audience and a validity window appear in JWT claims, ID tokens and SAML conditions alike, and the same validation order applies. - **Publish configuration at a known place.** Discovery documents, key sets and SAML metadata let a relying party learn endpoints and keys from one identifier and follow key rotation without redeployment. - **Exchange one credential for a narrower one.** A password becomes a code, a code becomes an access token, a refresh token becomes a fresh access token; each step reduces what the next holder can do. - **Delegate trust upward.** Federation trust anchors and superior statements let a verifier accept a party it has never met, because someone it already trusts vouches for it.

explore

→ has its own guide

report an issue with this guide →

questions

177 · 5 sections

In OAuth 2.0, what makes a client confidential rather than public, and where does an installed mobile app fall?

level: juniorimportance: must knowfreq 66%
basics
~20 s

RFC 6749 section 2.1 types a client on one property: whether it can keep its credentials confidential. Server-side code can. An installed mobile app cannot, so it is public — a secret shipped inside it is readable by whoever installs it.

open as a page

Why does an OAuth 2.0 client send the user to the authorization server to log in and then back?

level: juniorimportance: must knowfreq 75%
basics
~20 s

The authorization code grant keeps the resource owner's password at the authorization server. The user authenticates there, and the client receives only a short-lived authorization code, which it exchanges on a back channel for a scoped access token.

open as a page

Why does RFC 8252 have a native mobile app open its OAuth 2.0 authorization request in the device's browser rather than an embedded web view?

level: juniorimportance: must knowfreq 55%
basics
~20 s

RFC 8252 keeps the authorization request in an external user-agent because an embedded web view runs inside the application: the application can observe what is typed into it, including the resource owner's credentials, and it shares no signed-in session with the browser.

open as a page

In an OAuth 2.0 authorization-code flow, what attack does PKCE (RFC 7636) exist to stop?

level: juniorimportance: must knowfreq 66%
basics
~20 s

PKCE stops authorization-code interception. An attacker who captures the code as it travels back through the browser cannot redeem it, because the token request must also carry a code_verifier that only the application which started the flow holds.

open as a page

Your app registers a callback URL with a partner authorization server; why must its redirect_uri match that registration exactly?

level: juniorimportance: must knowfreq 68%
basics
~20 s

Exact string matching is what ties an issued authorization code to the application that asked for it. Any looser rule - prefix, substring or wildcard - lets an attacker steer the response to a destination the client never registered.

open as a page

Given only an issuer URL, how does a relying party find and use the OpenID Provider configuration document?

level: juniorimportance: must knowfreq 58%
basics
~10 s

Remove any terminating slash from the issuer URL, then concatenate /.well-known/openid-configuration to it. The JSON object returned carries issuer, authorization_endpoint, token_endpoint, userinfo_endpoint and jwks_uri, so one configured value yields every address the flow needs.

open as a page

In OpenID Connect, what does `response_type=code` ask a provider to return to the client's redirect URI?

level: juniorimportance: must knowfreq 72%
basics
~20 s

A single short-lived authorization code, and nothing else. With response_type=code the provider puts no ID token and no access token on the redirect; the client exchanges the code at the token endpoint and receives both there.

open as a page

In OpenID Connect, what does an ID token tell a relying party that an access token never does?

level: juniorimportance: must knowfreq 74%
basics
~20 s

An OpenID Connect ID token is a signed statement, addressed to the client that asked, that a named user just authenticated at a named issuer. An access token authorises an API call and says nothing about who signed in.

open as a page

In OpenID Connect, which scope value must an authorization request include, and what does including it change?

level: juniorimportance: must knowfreq 74%
basics
~20 s

An authorization request becomes an OpenID Connect authentication request only when its scope parameter includes the value openid. That value makes the provider issue an ID token; without it the exchange is plain OAuth 2.0 authorization.

open as a page

At the OpenID Connect UserInfo endpoint, which credential does a relying party present, and what comes back?

level: juniorimportance: must knowfreq 64%
basics
~20 s

The UserInfo endpoint is an OAuth 2.0 protected resource. The relying party presents the access token from the same sign-in as a bearer credential over TLS, and receives a JSON object of claims about that end user.

open as a page

What do a JWT's iss, sub, aud, exp and iat claims mean?

level: juniorimportance: must knowfreq 85%
basics
~20 s

iss names who issued the token, sub the principal the claims describe, aud the intended recipients, exp the moment from which it must not be accepted, and iat when it was issued. All are optional registered claim names.

open as a page

In JOSE, what is the difference between a JWS and a JWE, and who can read each payload?

level: juniorimportance: must knowfreq 75%
basics
~20 s

A JWS is signed but not encrypted: anyone holding it can decode and read the claims, and the signature only proves they were not altered. A JWE encrypts the payload, so only a holder of the decryption key can read it.

open as a page

Why must you never put a secret in a JWT payload even though the token is signed?

level: juniorimportance: must knowfreq 74%
basics
~20 s

Signing protects integrity, not confidentiality. A JWS payload is only Base64url-encoded, so anyone holding the token — or reading a log, a proxy trace or browser storage — can decode every claim. Secrets belong outside the token or inside an encrypted one.

open as a page

Why can anyone read a signed JWT's payload, and what does that mean for what you put in it?

level: juniorimportance: must knowfreq 78%
basics
~20 s

Base64url is an encoding, not encryption, and a signature protects integrity rather than confidentiality. Anyone holding a signed JWT can decode its claims, so it must carry no secrets and no data the holder should not see.

open as a page

What are the three dot-separated parts of a JWT, and what does each contain?

level: juniorimportance: must knowfreq 88%
basics
~10 s

A signed JWT is three Base64url segments joined by dots: a JOSE header naming the algorithm and key, a JSON claims payload, and a signature computed over the first two segments.

open as a page

Why does the SAML HTTP-POST binding show the user a page that submits itself, and what is on that form?

level: juniorimportance: must knowfreq 52%
basics
~20 s

A browser will not originate a cross-site POST on its own, so the sender returns a page holding a form aimed at the recipient's endpoint and submits it by script. The form carries the base64-encoded SAML message in a hidden control named SAMLRequest or SAMLResponse.

open as a page

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%
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.

open as a page

In SAML 2.0 web single sign-on, what makes a login SP-initiated rather than IdP-initiated?

level: juniorimportance: must knowfreq 50%
basics
~20 s

SP-initiated login starts at the service provider, which sends the browser to the identity provider carrying an AuthnRequest message. IdP-initiated login starts at the identity provider, which sends an unsolicited Response the service provider never asked for.

open as a page

What does `<AudienceRestriction>` constrain in a SAML assertion, and what does a missing one allow?

level: middleimportance: must knowfreq 52%
basics
~20 s

AudienceRestriction names, by entityID URI, the parties the assertion is addressed to; anyone not named must not rely on it. With none present, every service provider that receives a copy can read it as addressed to itself, and nothing in the document contradicts that.

open as a page

In a SAML assertion, what does the `<Conditions>` `NotOnOrAfter` bound that `<SubjectConfirmationData>` `NotOnOrAfter` does not?

level: middleimportance: must knowfreq 58%
basics
~20 s

The Conditions NotOnOrAfter bounds how long the assertion is a valid statement at all; the SubjectConfirmationData NotOnOrAfter bounds only how long this bearer may present it for delivery. They are two separate clocks and both must hold.

open as a page

What does it mean for two organisations to federate login between their identity providers, and what does each side stop doing?

level: juniorimportance: must knowfreq 60%
basics
~20 s

Federating login between organisations means each organisation's own identity provider authenticates its own people and vouches for them to the other's application. The application stops issuing credentials and storing passwords for those users, and instead validates a signed statement about them.

open as a page

In a multi-party login federation, what must be agreed before one member's identity provider is trusted by another?

level: juniorimportance: must knowfreq 50%
basics
~20 s

Both members must already trust the same third party, a federation Trust Anchor, and each must publish a signed statement about itself under it. The anchor's attestation, not a private agreement between the two, is what makes the other side acceptable.

open as a page

In RFC 8485, what does the vector `P1.Cc.Ac` claim, and what does its absent `M` component mean?

level: middleimportance: must knowfreq 42%
basics
~20 s

It makes three component claims — a proofing value, a primary-credential-usage value and an assertion-presentation value — whose meanings come from the trust framework named alongside it. The missing M component is not a zero: no claim is made about credential management.

open as a page

When choosing between SAML 2.0 and OpenID Connect, what does each one's credential format demand of the relying side?

level: middleimportance: must knowfreq 55%
basics
~20 s

SAML 2.0 delivers an XML assertion with an XML Signature over it, so the relying side needs an XML toolchain that canonicalises and verifies documents. OpenID Connect delivers a JWT verified with a JOSE library against a published key set. That difference decides which platforms can cheaply be a relying party.

open as a page

Two partners each assert `P1` under their own trust frameworks — why can you not compare those claims, and what do you build instead?

level: seniorimportance: must knowfreq 38%
basics
~20 s

Component values are defined per trust framework and carry no ordinal or subsumptive meaning, so identical strings from two frameworks are not comparable. Build a mapping table per framework, keyed by its trustmark, that translates each partner's claims into your own policy decisions.

open as a page