Free tech learning for everyone, from basics to pro

IAMCloud SecurityIntermediate

Single sign-on and federation: SAML, OAuth 2.0 and OpenID Connect

In short: Single sign-on lets people log in once to a trusted identity provider and reach many applications without new passwords. Federation is the trust that makes this work across organisations. SAML and OpenID Connect handle sign-in; OAuth 2.0 handles delegated access to APIs.

Single sign-on and federation

Single sign-on (SSO) means a user authenticates once and then reaches many applications without signing in again. Federation is the trust relationship behind it: an application (the service provider or relying party) agrees to accept proof of identity issued by an identity provider (IdP). The two sides exchange metadata and signing keys in advance, so the application can verify that a token really came from the IdP and has not been altered.

The security benefits are significant. Users have one strong credential instead of dozens of weak ones, MFA is enforced in one place, and disabling a leaver in the IdP cuts off every connected application at once.

A typical OpenID Connect sign-inUser opensappnot signed inRedirect toIdPlogin requestIdP signs inpassword, MFAToken issuedcode then IDtokenApp sessionuser is in
Figure 1. In federated sign-in the application never sees the password; it trusts a signed token from the identity provider.

SAML 2.0

Security Assertion Markup Language (SAML) 2.0 is an XML-based standard that has been the backbone of enterprise SSO for many years. After the user signs in, the IdP sends a digitally signed assertion to the application, usually through the browser. The assertion states who the user is and can carry attributes such as email address, department or group membership. SAML is common for connecting a company directory to SaaS tools such as HR, payroll and ticketing systems.

OAuth 2.0 and OpenID Connect

OAuth 2.0 is about authorisation, not login. It lets a user allow one application to act on their behalf against an API, without handing over their password. The result is an access token with a limited scope (for example, read calendar only) and a short lifetime. Think of a hotel key card: it opens certain doors for a set period, but it says little about who you are.

OpenID Connect (OIDC) adds an identity layer on top of OAuth 2.0. As well as an access token, the application receives an ID token, a signed JSON Web Token (JWT) describing the user. OIDC is the usual choice for modern web and mobile apps and for cloud consoles. For browser and mobile apps the recommended flow is the authorisation code flow with PKCE (Proof Key for Code Exchange), which protects the code from being intercepted and reused.

Protocols comparedSAML 2.0XML assertions, enterpriseSSOOAuth 2.0delegated authorisationOpenID Connectidentity layer on OAuthSCIMaccount provisioningKerberoson-premises ticketsWS-Federationolder Microsoft SSO
Figure 2. The protocols you are most likely to meet; the top row covers nearly all modern cloud sign-in.
FeatureSAML 2.0OAuth 2.0OpenID Connect
Main purposeSign-in (SSO)Delegated API accessSign-in (SSO)
Token formatXML assertionAccess token (often JWT)ID token (JWT) plus access token
Typical useEnterprise SaaSApps calling APIsWeb, mobile, cloud consoles

Risks and good practice

  • The IdP becomes a crown jewel. Protect its admin accounts with phishing-resistant MFA and watch for changes to federation trusts and signing certificates.
  • Validate tokens properly. Check the signature, issuer, audience and expiry. Never accept unsigned tokens.
  • Consent phishing. Attackers trick users into granting a malicious OAuth app broad scopes. Restrict which apps users can approve and review granted permissions.
  • Token theft. Stolen session tokens can bypass MFA. Keep token lifetimes short and use conditional access to bind sessions to managed devices where possible.

Tip: a handy exam line is "OAuth is for authorisation, OIDC is for authentication, SAML is the older XML way to do SSO".

Practice

Your company wants staff to sign in to a SaaS HR system with their corporate account. Which protocols could do this?
SAML 2.0 or OpenID Connect, with the corporate IdP as the identity provider and the HR system as the service provider.
Why is OAuth 2.0 on its own not a login protocol?
It issues access tokens for APIs and does not define a standard way to tell the application who the user is. OpenID Connect adds the ID token for that.
What does PKCE protect against?
Interception and reuse of the authorisation code, which matters for browser and mobile apps that cannot keep a client secret.

Key takeaways

  • SSO means one sign-in for many apps; federation is the trust that enables it.
  • SAML uses signed XML assertions and is common for enterprise SaaS.
  • OAuth 2.0 delegates API access with scoped, short-lived tokens.
  • OpenID Connect adds an ID token to OAuth and is the modern sign-in choice.
  • Protect the IdP, validate tokens fully and control OAuth app consent.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.