Guide 9 min read

How Single Sign-On (SSO) Works: A Technical Deep Dive

What is Single Sign-On (SSO)?

Single Sign-On (SSO) is an authentication method that allows users to access multiple applications and websites with a single set of login credentials. Instead of remembering different usernames and passwords for each application, users only need to authenticate once to gain access to all authorised resources. This simplifies the user experience and improves security by reducing password fatigue and the risk of weak or reused passwords.

Imagine a scenario where an employee needs to access their email, CRM, and project management software daily. Without SSO, they would need to enter their username and password for each application separately. With SSO, they log in once, usually at the beginning of their workday, and can seamlessly access all three applications without further authentication.

From a technical perspective, SSO relies on a trusted relationship between a central identity provider (IdP) and multiple service providers (SPs). The IdP is responsible for verifying the user's identity, while the SPs trust the IdP's assertion of the user's identity. This trust is established through various protocols and standards, which we will explore in the next section.

SSO Protocols and Standards

Several protocols and standards enable SSO functionality. These protocols define how identity information is exchanged between the IdP and the SPs. Here are some of the most common:

Security Assertion Markup Language (SAML): SAML is an XML-based open standard for exchanging authentication and authorisation data between security domains. It's one of the most widely used protocols for web-based SSO. SAML defines three roles: the principal (user), the IdP, and the SP. The process involves the user attempting to access a resource on the SP, the SP redirecting the user to the IdP for authentication, the IdP authenticating the user and issuing a SAML assertion, and the IdP sending the assertion back to the SP, which then grants access to the user.

OpenID Connect (OIDC): OIDC is an authentication layer built on top of the OAuth 2.0 authorisation framework. It allows clients to verify the identity of users based on the authentication performed by an authorisation server, as well as to obtain basic profile information about the user. OIDC is often preferred for mobile and web applications due to its simplicity and RESTful nature. It uses JSON Web Tokens (JWTs) to securely transmit user information.

Kerberos: Kerberos is a network authentication protocol that uses secret-key cryptography to provide strong authentication for client/server applications. It relies on a trusted third party, the Key Distribution Centre (KDC), to issue tickets that allow clients to access services without repeatedly entering their credentials. Kerberos is commonly used in enterprise environments, particularly with Microsoft Active Directory.

Lightweight Directory Access Protocol (LDAP): While not strictly an SSO protocol, LDAP is often used in conjunction with SSO solutions to manage user identities and access control. LDAP provides a standardised way to access and modify directory information, such as user accounts, groups, and permissions. Many IdPs use LDAP to authenticate users against an existing directory service.

Choosing the right protocol depends on various factors, including the types of applications you need to support, your security requirements, and your existing infrastructure. For example, SAML is well-suited for web applications that require strong security, while OIDC is often preferred for mobile and modern web applications. Learn more about Login and how we can help you choose the best protocol for your organisation.

Protocol Comparison

| Feature | SAML | OpenID Connect | Kerberos | LDAP |
| ---------------- | ------------------------------------- | ------------------------------------- | -------------------------------------- | --------------------------------------- |
| Purpose | Web-based SSO | Authentication and authorisation | Network authentication | Directory access |
| Data Format | XML | JSON | Binary | Protocol-specific |
| Complexity | High | Medium | High | Medium |
| Use Cases | Enterprise web applications | Mobile and modern web applications | Enterprise network environments | User directory management |
| Security | Strong | Strong | Strong | Dependent on implementation |

SSO Architecture and Components

An SSO system typically consists of the following key components:

Identity Provider (IdP): The IdP is the central authority responsible for authenticating users and managing their identities. It verifies the user's credentials and issues security tokens or assertions that can be used by SPs to grant access. Examples of IdPs include Microsoft Azure AD, Okta, and Google Identity Platform.

Service Provider (SP): The SP is the application or website that the user is trying to access. It relies on the IdP to authenticate the user and trusts the IdP's assertion of the user's identity. The SP typically integrates with the IdP through one of the SSO protocols mentioned earlier.

User Agent: The user agent is the client application used by the user to access the SP, typically a web browser. The user agent interacts with both the IdP and the SP during the SSO process.

Authentication Request: When a user attempts to access a protected resource on the SP, the SP sends an authentication request to the IdP. This request typically includes information about the SP and the resource being requested.

Authentication Response: After the IdP authenticates the user, it sends an authentication response back to the SP. This response contains information about the user's identity and authorisation, typically in the form of a security token or assertion.

Security Token/Assertion: A security token or assertion is a digitally signed document that contains information about the user's identity and authorisation. It is used by the SP to verify the user's identity and grant access to the requested resource. SAML assertions and JWTs are common examples of security tokens.

SSO Workflow Example (SAML)


  • The user attempts to access a protected resource on the SP.

  • The SP redirects the user to the IdP for authentication.

  • The user authenticates with the IdP (e.g., by entering their username and password).

  • The IdP issues a SAML assertion containing information about the user's identity.

  • The IdP sends the SAML assertion back to the SP.

  • The SP validates the SAML assertion and grants access to the user.

Implementing SSO in Your Organisation

Implementing SSO can significantly improve user experience and security, but it requires careful planning and execution. Here are some key considerations:

Choose the Right SSO Solution: Select an SSO solution that meets your organisation's specific needs and requirements. Consider factors such as the types of applications you need to support, your security requirements, and your budget. There are many SSO providers available, offering varying features and pricing models. When choosing a provider, consider what Login offers and how it aligns with your needs.

Integrate with Existing Identity Management Systems: Integrate your SSO solution with your existing identity management systems, such as Active Directory or LDAP. This will allow you to leverage your existing user accounts and permissions, simplifying the implementation process.

Configure Trust Relationships: Establish trust relationships between the IdP and the SPs. This involves configuring the SPs to trust the IdP's assertions of user identity. This configuration typically involves exchanging metadata between the IdP and the SPs.

Implement Multi-Factor Authentication (MFA): Enhance security by implementing MFA for SSO. This requires users to provide multiple forms of authentication, such as a password and a one-time code from their mobile device. MFA can significantly reduce the risk of unauthorised access, even if a user's password is compromised.

Test Thoroughly: Thoroughly test your SSO implementation before deploying it to production. This includes testing with different browsers, devices, and applications to ensure that everything is working as expected. Pay particular attention to error handling and ensure that users are provided with clear and helpful error messages if something goes wrong.

Provide User Training: Provide users with training on how to use SSO. This will help them understand the benefits of SSO and how to log in to applications using their SSO credentials. Clear and concise instructions can help avoid user frustration and reduce support requests.

Security Considerations for SSO

While SSO can improve security, it also introduces new security risks that need to be addressed. Here are some key security considerations for SSO:

Protect the IdP: The IdP is the most critical component of the SSO system, as it is responsible for authenticating users and issuing security tokens. It is essential to protect the IdP from attacks, such as password brute-forcing, phishing, and denial-of-service attacks. Implement strong authentication mechanisms, such as MFA, and regularly monitor the IdP for suspicious activity.

Secure Communication Channels: Ensure that all communication between the IdP, the SPs, and the user agent is encrypted using HTTPS. This will prevent attackers from eavesdropping on sensitive information, such as usernames, passwords, and security tokens.

Validate Security Tokens: SPs must carefully validate security tokens received from the IdP to ensure that they are authentic and have not been tampered with. This includes verifying the digital signature of the token and checking the expiration date.

Implement Session Management: Implement robust session management mechanisms to prevent session hijacking and replay attacks. This includes setting appropriate session timeouts and invalidating sessions when users log out.

Regular Security Audits: Conduct regular security audits of your SSO implementation to identify and address potential vulnerabilities. This should include penetration testing, vulnerability scanning, and code reviews.

Stay Up-to-Date: Keep your SSO software and libraries up-to-date with the latest security patches. This will help protect against known vulnerabilities and ensure that your SSO system is as secure as possible. Consult the frequently asked questions for more information on keeping your systems secure.

By carefully considering these security considerations, you can ensure that your SSO implementation is secure and protects your organisation from unauthorised access. SSO can be a powerful tool for improving user experience and security, but it is essential to implement it correctly and maintain it properly.

Related Articles

Guide • 2 min

Understanding Multi-Factor Authentication (MFA)

Tips • 2 min

Securing Your Mobile Devices: Best Practices for Login Security

Comparison • 2 min

Cloud-Based vs. On-Premise Identity Management Solutions

Want to own Login?

This premium domain is available for purchase.

Make an Offer