Tutorial 3.14: Federated Identity and Single Sign-On

Table of Contents

Learning Objectives

After completing this tutorial, you should be able to:

Overview

In modern digital ecosystems, users often need to access resources across multiple organizations—partners, suppliers, customers, and cloud services. Managing separate credentials for each domain is inefficient, insecure, and user-unfriendly. Federated identity addresses these challenges by enabling users from one organization (the identity provider) to authenticate and access resources in another organization (the service provider) using a single set of credentials. This is the foundation of Single Sign-On (SSO), which provides a seamless user experience while reducing password fatigue and administrative overhead.

This tutorial provides a comprehensive exploration of federated identity and SSO. We begin by defining the core concepts: Identity Provider (IdP), Service Provider (SP), and the trust relationships that underpin federation. We discuss the different federation models: direct trust (point-to-point) and brokered trust (via a federation hub). We then examine the three dominant protocols: SAML 2.0 (Security Assertion Markup Language), OAuth 2.0 (an authorization framework), and OpenID Connect (OIDC) (an identity layer on top of OAuth 2.0).

We dive deep into SAML 2.0, covering its architecture, assertions, bindings, and profiles, and walk through the Web Browser SSO profile. We then analyze OAuth 2.0, explaining its roles, grant types, and token usage, and how it enables delegated access. We then explore OIDC, which extends OAuth 2.0 with an ID token and standardized claims, making it suitable for authentication. We compare the protocols, providing guidance on when to use each.

Security is a critical aspect of federation. We discuss threats such as assertion tampering, token theft, and session hijacking, and describe countermeasures like signing, encryption, and audience restriction. The tutorial concludes with case studies: enterprise SSO using SAML and OIDC, social login with OIDC, and academic federations like InCommon. By the end, you will have a thorough understanding of federated identity and SSO, enabling you to design and implement solutions that provide secure, seamless access across organizational boundaries.

1. Introduction to Federated Identity

1.1 What is Federated Identity?

Federated identity is a system that allows a user to use a single digital identity to access resources across multiple domains or organizations. It is based on trust relationships between participating entities. The user's identity is managed by an Identity Provider (IdP), which authenticates the user and provides assertions about the user's identity to Service Providers (SPs) that rely on those assertions to grant access.

Federation eliminates the need for users to maintain separate credentials for each service, reducing password fatigue and the risk of credential reuse. It also simplifies administration for SPs, as they can outsource authentication to trusted IdPs.

1.2 Key Benefits

1.3 Core Roles

Key Takeaway: Federated identity allows users to use a single identity across multiple organizations, improving user experience, security, and administrative efficiency.

2. Single Sign-On (SSO) Concepts

2.1 What is SSO?

Single Sign-On (SSO) is a property of an authentication system that allows a user to log in once and gain access to multiple applications without being prompted to log in again. SSO is a key benefit of federated identity. It can be implemented within a single organization (enterprise SSO) or across organizations (federated SSO).

2.2 How SSO Works

In a typical federated SSO scenario, the user attempts to access an SP. The SP redirects the user to the IdP for authentication. The IdP authenticates the user (if not already authenticated) and returns an assertion to the SP. The SP validates the assertion and grants access. Subsequent access attempts to other SPs that trust the same IdP do not require re-authentication, as the user already has a session at the IdP.

2.3 SSO in Practice

SSO is implemented using federation protocols like SAML, OIDC, or proprietary mechanisms. The IdP maintains a session for the user, often using a cookie or a browser token. When a user accesses a new SP, the IdP checks if the user has an active session and, if so, issues a new assertion without prompting for credentials.

2.4 Enterprise SSO vs. Federated SSO

Important: SSO is not a protocol but a capability. It is achieved through protocols like SAML, OIDC, or CAS (Central Authentication Service).

3. Trust Relationships and Federation Models

3.1 Trust Basics

In federation, trust is established between the IdP and SP. Trust means that the SP accepts the IdP's assertions as valid proof of identity. Trust is typically established through:

3.2 Federation Models

3.3 Federation Agreements

Organizations typically sign a Federation Agreement that defines the terms of participation, including data protection, privacy, liability, and operational procedures.

Key Takeaway: Trust is the foundation of federation. It can be established directly or through a broker, and is formalized via metadata exchange and legal agreements.

4. Federation Protocols: SAML, OAuth, OIDC

4.1 Overview

Three protocols dominate the federated identity landscape:

4.2 Protocol Comparison

Aspect SAML 2.0 OAuth 2.0 OpenID Connect (OIDC)
Primary Purpose Authentication and authorization (SSO) Authorization (delegated access) Authentication (identity layer on OAuth)
Data Format XML (SAML assertions) JSON (tokens: access token, refresh token) JSON (ID token, claims)
Typical Use Enterprise SSO, web applications API access, mobile apps, third-party login Consumer SSO, mobile, modern web
Bindings HTTP Redirect, POST, SOAP HTTP (REST) with bearer tokens HTTP (REST) with bearer tokens
User Info In assertion (attributes) Via User Info endpoint (OAuth) In ID token and User Info endpoint
Complexity Complex (XML, heavy) Moderate Moderate (simpler than SAML)
Note: OAuth 2.0 is an authorization framework, not an authentication protocol. OIDC adds authentication capabilities on top of OAuth 2.0.

5. SAML 2.0 Architecture and Flows

5.1 SAML Components

5.2 Web Browser SSO Profile

The most common SAML use case. It involves a user accessing an SP via a browser. The flow is:

  1. User attempts to access a protected resource at the SP.
  2. SP generates an AuthnRequest and sends it to the IdP via a redirect (or POST) binding.
  3. IdP authenticates the user (if not already authenticated) and generates an assertion.
  4. IdP sends the assertion to the SP via HTTP POST (or artifact binding).
  5. SP validates the assertion, creates a session for the user, and grants access.

5.3 SAML Assertion Structure (Simplified)

<saml:Assertion ...> <saml:Issuer>https://idp.example.com</saml:Issuer> <saml:Subject> <saml:NameID>user@example.com</saml:NameID> </saml:Subject> <saml:AuthnStatement AuthnInstant="..."> <saml:AuthnContext> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml:AuthnContextClassRef> </saml:AuthnContext> </saml:AuthnStatement> <saml:AttributeStatement> <saml:Attribute Name="email"><saml:AttributeValue>user@example.com</saml:AttributeValue></saml:Attribute> </saml:AttributeStatement> </saml:Assertion>

5.4 SAML Security

Key Takeaway: SAML 2.0 is a mature, XML-based protocol for enterprise SSO. It provides strong security features but is more complex than OIDC.

6. OAuth 2.0 Authorization Framework

6.1 OAuth 2.0 Overview

OAuth 2.0 is an authorization framework that enables a third-party application to obtain limited access to a user's resources (e.g., files, contacts) without exposing the user's credentials. It defines four roles:

6.2 Grant Types

OAuth 2.0 defines several grant flows (authorization grant types):

6.3 Token Types

6.4 OAuth 2.0 Security Considerations

Note: OAuth 2.0 is an authorization framework, not an authentication protocol. It does not provide user identity information beyond the token. That is the role of OpenID Connect.

7. OpenID Connect (OIDC)

7.1 What is OIDC?

OpenID Connect (OIDC) is an identity layer built on top of OAuth 2.0. It adds authentication and provides user identity information in a standardized way. OIDC is widely used for consumer SSO (e.g., "Login with Google") and modern enterprise applications.

7.2 OIDC Roles

7.3 OIDC Tokens

7.4 OIDC Flows

OIDC uses the same OAuth 2.0 grant types, with the addition of the ID token. The most common flows are:

7.5 OIDC Claims

Claims are pieces of information about the user. Standard claims include:

Additional claims can be requested using the scope parameter (e.g., profile, email, address, phone).

7.6 OIDC Security

Key Takeaway: OIDC is a modern, lightweight identity protocol based on OAuth 2.0. It provides authentication, user claims, and is widely adopted for web and mobile applications.

8. Comparison and Selection

8.1 When to Use Each Protocol

8.2 Hybrid Scenarios

Many organizations use a mix: SAML for enterprise SSO with legacy apps, and OIDC for mobile and cloud-native applications. Federation bridges (e.g., Azure AD, PingFederate) can translate between protocols.

8.3 Summary Table

Protocol Best For Complexity Support
SAML 2.0 Enterprise SSO, web apps High Wide (legacy & modern)
OAuth 2.0 API authorization Moderate Very wide
OpenID Connect Consumer and enterprise SSO, mobile Moderate Rapidly growing

9. Security Considerations

9.1 Common Threats

9.2 Best Practices

Warning: Federation introduces additional attack surface. Security must be carefully designed and monitored to prevent trust exploitation.

10. Case Studies

10.1 Case Study: Enterprise SSO with SAML and OIDC

Background: A large enterprise with 10,000 employees uses a central identity provider (Azure AD). The organization has a mix of legacy on-premises applications (SAP, SharePoint) and modern cloud applications (Salesforce, Office 365, Workday).

Solution:

Outcome: Users enjoy seamless SSO across all applications. Security is enhanced with MFA and conditional access. Administrative overhead is reduced.

10.2 Case Study: Academic Federation (InCommon)

Background: InCommon is the U.S. academic federation, with over 600 institutions. It uses SAML 2.0 to enable SSO for students and researchers across member institutions.

How it works:

Benefits: Researchers can access a wide range of resources using their campus credentials. SPs simplify user management by outsourcing authentication.

10.3 Case Study: Social Login with OIDC

Background: A consumer-facing website wants to allow users to sign in with their Google or Facebook accounts. This reduces friction and increases conversion rates.

Solution:

Outcome: Users can sign in quickly without creating new passwords. The website collects essential user information while delegating authentication.

11. Summary and Transition

This tutorial provided a comprehensive exploration of federated identity and single sign-on. We defined federated identity as a system that allows users to use a single identity across multiple organizations, and SSO as the seamless authentication experience it enables. We discussed the core roles—Identity Provider (IdP), Service Provider (SP)—and the trust relationships that underpin federation, including direct and brokered trust models.

We then examined the three main protocols: SAML 2.0 (mature, XML-based, enterprise SSO), OAuth 2.0 (authorization framework for delegated access), and OpenID Connect (identity layer on OAuth 2.0). We analyzed each protocol's architecture, flows, and security features, and provided guidance on when to use each. We also covered security considerations, including common threats and best practices.

The case studies illustrated enterprise SSO with both SAML and OIDC, academic federation (InCommon), and social login with OIDC. These examples demonstrated how federation is applied in practice to meet diverse needs.

This tutorial has equipped you with a thorough understanding of federated identity and SSO, enabling you to design and implement solutions that provide secure, seamless access across organizational boundaries. In the next tutorial, Tutorial 3.15, we will explore Internet Authentication Applications, covering protocols like RADIUS, TACACS+, and Diameter that are used for network access authentication.

Quiz

Answer the following questions to check your understanding. Click the "Answer" button to reveal the solution.

Q1. In a federated identity system, which component authenticates the user and issues assertions?

Answer
B) The Identity Provider (IdP) authenticates the user and issues assertions.

Q2. Which protocol is an XML-based standard for exchanging authentication and authorization data?

Answer
C) SAML 2.0 is an XML-based standard for exchanging authentication and authorization data.

Q3. What is the primary purpose of OAuth 2.0?

Answer
B) OAuth 2.0 is an authorization framework for delegated access.

Q4. Which OIDC token is a JWT that contains claims about the user's identity?

Answer
C) The ID token contains claims about the user's identity.

Q5. In a SAML Web Browser SSO profile, the assertion is typically sent from the IdP to the SP via:

Answer
B) The assertion is often sent via HTTP POST binding.

Q6. Which security feature in SAML prevents an assertion from being used by a different SP?

Answer
C) Audience restriction limits the assertion to a specific SP.

Q7. In OAuth 2.0, which grant type is used for server-side web applications?

Answer
B) The Authorization Code grant is used for server-side web apps.

Q8. Which protocol is built on top of OAuth 2.0 and provides authentication?

Answer
B) OpenID Connect is an identity layer built on OAuth 2.0.

Q9. Which federation model involves a central broker that manages trust between IdPs and SPs?

Answer
B) Brokered trust uses a central broker or hub.

Q10. Which OIDC claim uniquely identifies the user?

Answer
C) The sub (subject) claim uniquely identifies the user.

Q11. In OAuth 2.0, which parameter is used to protect against CSRF attacks in the authorization code flow?

Answer
B) The state parameter protects against CSRF attacks.

Q12. Which protocol is commonly used for academic federations like InCommon?

Answer
C) SAML 2.0 is the protocol used in InCommon and many other academic federations.

Exercises

These exercises are designed to help you apply the concepts from this tutorial. Attempt each exercise before revealing the sample solution.

Exercise 3.14-1: SAML Flow Tracing

Describe the complete SAML 2.0 Web Browser SSO flow, including all messages and redirects. Assume the user is not yet authenticated. Include the roles, bindings, and the contents of the AuthnRequest and Response. What is the purpose of the RelayState parameter?

Sample Solution

SAML Web Browser SSO Flow:

  1. User accesses a protected resource at the SP (e.g., https://sp.example.com/secure).
  2. SP checks for an existing session; if none, it generates an AuthnRequest (with an ID, issue instant, and optionally a RelayState) and sends it to the IdP via a redirect (HTTP Redirect binding) or POST.
  3. User is redirected to the IdP's Single Sign-On endpoint.
  4. IdP processes the AuthnRequest, authenticates the user (if not already authenticated), and generates an assertion containing authentication and attribute statements.
  5. IdP sends the assertion to the SP via HTTP POST (most common) with the RelayState (if any).
  6. SP receives the POST, validates the assertion (signature, audience, expiration), extracts the user identity and attributes, creates a session, and redirects the user to the originally requested resource.

RelayState: A parameter that allows the SP to pass state information (e.g., the target URL) to the IdP and have it returned, enabling the SP to redirect the user to the correct page after authentication.

Exercise 3.14-2: OIDC Integration

You are developing a web application that needs to authenticate users using Google as the OpenID Provider. Describe the steps to integrate OIDC, including the configuration required, the endpoints used, and the token validation process. What scopes would you request to obtain the user's email and profile information?

Sample Solution

OIDC Integration with Google:

  • Register the application with Google Cloud Console to obtain a client ID and client secret.
  • Configure the redirect URI (e.g., https://yourapp.com/callback).
  • When a user clicks "Login with Google", redirect to Google's authorization endpoint: https://accounts.google.com/o/oauth2/v2/auth with parameters: client_id, redirect_uri, response_type=code, scope=openid%20email%20profile, state (random string).
  • Google authenticates the user and returns an authorization code to the redirect URI.
  • Your app exchanges the code for tokens by calling https://oauth2.googleapis.com/token with client_id, client_secret, code, redirect_uri, and grant_type=authorization_code.
  • Google returns an ID token (JWT), access token, and refresh token.
  • Validate the ID token: verify signature, issuer (accounts.google.com), audience (your client ID), expiration, and nonce (if used).
  • Extract user claims from the ID token (sub, email, name).
  • Optionally, fetch additional claims from the UserInfo endpoint: https://openidconnect.googleapis.com/v1/userinfo using the access token.
  • Create a local session for the user.

Scopes: openid email profile to obtain basic profile information.

Exercise 3.14-3: OAuth 2.0 Grant Type Selection

You have three different applications:

  1. A traditional web application (server-side, with a backend).
  2. A single-page application (SPA) running entirely in the browser.
  3. A mobile app that needs to access a user's Google Drive files.

Which OAuth 2.0 grant type would you recommend for each and why? Discuss any security considerations for each.

Sample Solution
  • 1. Traditional web app: Authorization Code grant. The app can keep the client secret secure on the server. It exchanges the code for tokens, reducing the risk of token interception. Use PKCE for added security.
  • 2. SPA: Authorization Code with PKCE (or Implicit if PKCE is not available, but PKCE is now preferred). The app cannot keep a secret, so PKCE prevents authorization code interception. Use state parameter for CSRF protection.
  • 3. Mobile app: Authorization Code grant with PKCE. Use a custom URI scheme for the redirect. The mobile app can securely store a client secret? Actually, mobile apps are considered public clients; PKCE is essential.

Security: Always use HTTPS; validate redirect URIs; use short-lived access tokens; and use refresh tokens with rotation.

Exercise 3.14-4: Federation Trust Model

An organization wants to set up a federation with three partners. Each partner has its own IdP. The organization's SPs need to trust all three IdPs. Compare direct trust vs. a brokered trust model. Which would you recommend and why? What are the trade-offs?

Sample Solution

Direct Trust: Each SP must be configured to trust each IdP individually. This requires managing metadata (certificates, endpoints) for all IdPs. For three partners, that's manageable, but as the number grows, it becomes unwieldy. Each SP must also independently decide which IdPs to trust.

Brokered Trust: A federation hub (broker) is used. All IdPs and SPs trust the broker. The broker provides a single set of metadata and manages trust. SPs only need to trust the broker. This scales better and simplifies administration.

Recommendation: Brokered trust, even for only three partners, as it provides a clear framework for expansion and reduces administrative overhead. The broker can also enforce policies (e.g., attribute release). The main trade-off is the need to establish and maintain the broker infrastructure.

Exercise 3.14-5: SAML vs OIDC Comparison

You are migrating an enterprise SSO system from SAML 2.0 to OpenID Connect. What are the key differences in architecture, message format, and user experience? What challenges might you encounter? Provide a migration strategy.

Sample Solution

Key Differences:

  • Message format: SAML uses XML; OIDC uses JSON (JWT). OIDC is lighter and easier to consume in modern web/mobile apps.
  • Bindings: SAML uses HTTP Redirect, POST, and SOAP; OIDC uses HTTP/REST with bearer tokens.
  • User experience: Both provide SSO, but OIDC is more native to mobile and SPAs.
  • Security: Both support signing and encryption, but OIDC's JWT is simpler to implement.
  • Attributes: SAML uses AttributeStatement with arbitrary XML; OIDC uses claims in the ID token or UserInfo endpoint.

Challenges:

  • Legacy applications that only support SAML may need a federation gateway.
  • Re-configuring all SPs and IdPs to use OIDC.
  • User attribute mapping and consent.
  • Updating client applications to handle JWT tokens.

Migration Strategy:

  • Deploy a federation broker that supports both SAML and OIDC (e.g., Azure AD, PingFederate).
  • Migrate SPs one by one: start with modern applications using OIDC, then legacy applications via SAML.
  • Use the broker to translate between protocols during the transition.
  • Phase out SAML endpoints gradually.

Homework

These homework questions require deeper analysis, research, and application. Answer each question comprehensively.

Homework 3.14-1: Federated Identity Strategy

Write a 1,000–1,250 word strategy paper on implementing federated identity for a large enterprise that has multiple business units, each with its own identity systems, and also needs to collaborate with external partners. Include an analysis of the trust models, protocol choices, and governance framework. Discuss how to handle attribute release, consent, and privacy.

Sample Answer

Federated Identity Strategy for Enterprise

  • Assessment: Multiple IdPs (internal and external) and SPs (internal and SaaS).
  • Trust Model: Use a central hub (broker) to simplify trust management. Each internal business unit's IdP trusts the hub; external partners trust the hub.
  • Protocols: Use SAML 2.0 for legacy apps and OIDC for modern apps. Use the hub to translate.
  • Governance: Establish a federation agreement, define attribute release policies, and implement consent management.
  • Attribute Release: Minimize released attributes; use opt-in consent for sensitive attributes.
  • Privacy: Comply with GDPR/CCPA; provide user control over data sharing.

Homework 3.14-2: Security Analysis of Federation

Write a 750–1,000 word analysis of the security vulnerabilities in federated identity systems. Include at least five distinct threats, describe their impact, and propose specific countermeasures for each. Discuss the role of the IdP, SP, and the communication channels in security.

Sample Answer

Security Analysis of Federated Identity

  • Threat 1: Assertion Tampering – Impact: attacker modifies assertion to gain unauthorized access. Countermeasure: signing.
  • Threat 2: Token Theft – Impact: stolen access token used to access resources. Countermeasure: HTTPS, short lifetimes, token binding.
  • Threat 3: Redirect URI Manipulation – Impact: attacker intercepts authorization code. Countermeasure: strict redirect URI validation.
  • Threat 4: Phishing – Impact: user credentials stolen. Countermeasure: MFA, user education.
  • Threat 5: Session Hijacking – Impact: attacker uses stolen session cookie. Countermeasure: session timeout, IP binding, MFA.

IdP must protect user credentials and session; SP must validate tokens; channels must be encrypted (HTTPS).

Homework 3.14-3: OIDC vs SAML Research

Write a 1,000–1,250 word research paper comparing OpenID Connect and SAML 2.0 in terms of architectural principles, security features, deployment complexity, and suitability for modern applications. Provide a decision framework for choosing one over the other, including factors like application type, user base, and organizational context.

Sample Answer

OIDC vs SAML 2.0

  • Architecture: SAML is XML-based, uses complex bindings; OIDC is JSON/JWT, simpler REST.
  • Security: Both support signatures and encryption; OIDC's JWT is more widely supported in modern languages.
  • Deployment: SAML requires metadata exchange and more configuration; OIDC is simpler for developers.
  • Modern apps: OIDC is better for mobile and SPAs; SAML is still prevalent in enterprise.
  • Decision framework: Use SAML for legacy enterprise SSO; use OIDC for new applications, mobile, and consumer SSO.

Homework 3.14-4: Federation Implementation Plan

Develop a detailed implementation plan for setting up a federation between your organization and a key partner. Include steps for:

Sample Answer

Federation Implementation Plan

  • Step 1: Define use case and required attributes.
  • Step 2: Agree on protocol (SAML 2.0).
  • Step 3: Exchange metadata (entity IDs, endpoints, certificates).
  • Step 4: Configure IdP (your side) to release attributes to partner SP.
  • Step 5: Configure SP (partner side) to accept assertions from your IdP.
  • Step 6: Test with a test user; verify authentication and attribute release.
  • Step 7: Roll out to production users; provide documentation.
  • Step 8: Set up monitoring (log analysis, alerting).
  • Step 9: Plan for regular metadata updates and periodic testing.

Homework 3.14-5: Future of Federation

Write a 1,000–1,250 word essay on the future of federated identity. Discuss emerging trends such as decentralized identity (Self-Sovereign Identity), the role of blockchain, and the impact of AI on authentication and authorization. How will federation adapt to the needs of the Internet of Things (IoT) and edge computing?

Sample Answer

Future of Federated Identity

  • Decentralized Identity (SSI): Users control their own identity; federated models may evolve to support verifiable credentials.
  • Blockchain: Can provide a tamper-proof ledger for trust and consent.
  • AI: Risk-based authentication and anomaly detection will become integral to federation.
  • IoT: Billions of devices will need federated identity; lightweight protocols (e.g., OIDC for IoT) will emerge.
  • Zero Trust: Federation will integrate with continuous verification and micro-segmentation.

Summary

This tutorial provided a comprehensive exploration of federated identity and single sign-on. We defined federated identity as a system that enables users to use a single identity across multiple organizations, and SSO as the seamless authentication experience it enables. We discussed the core roles—Identity Provider (IdP), Service Provider (SP)—and the trust relationships that underpin federation, including direct and brokered trust models.

We then examined the three main protocols: SAML 2.0 (mature, XML-based, enterprise SSO), OAuth 2.0 (authorization framework for delegated access), and OpenID Connect (identity layer on OAuth 2.0). We analyzed each protocol's architecture, flows, and security features, and provided guidance on when to use each. We also covered security considerations, including common threats and best practices.

The case studies illustrated enterprise SSO with both SAML and OIDC, academic federation (InCommon), and social login with OIDC. These examples demonstrated how federation is applied in practice to meet diverse needs.

This tutorial has equipped you with a thorough understanding of federated identity and SSO, enabling you to design and implement solutions that provide secure, seamless access across organizational boundaries. In the next tutorial, Tutorial 3.15, we will explore Internet Authentication Applications, covering protocols like RADIUS, TACACS+, and Diameter that are used for network access authentication.

© 2026 COMP400 – Computer and Network Security • School of Computing and Information Systems, TrustOpen University • Unit 3: Authentication and Access Control