OAuth vs. OpenID vs. SAML: Understanding the Key Differences

Prasad Lakshan
UCSC ISACA Student Group
4 min readMar 7, 2023
Photo by Petteri Stenius from Ubisecure

Assume you are a business owner who wants to add a new web application to your company’s toolkit. You want to ensure that the application is secure, but you’re not sure how to do that. You confront a number of challenges: you must make it simple for your staff to utilize the program while also ensuring that only authorized users may do so. Furthermore, you don’t want to waste time and money implementing a custom authentication and authorization code for the new application.

Protocols such as OAuth, OpenID, and SAML can help with this. These protocols simplify user authentication and authorization, allowing you to save time and resources while still assuring the security of your new application. Nevertheless, which protocol should you use?

That is the topic of this blog post. We’ll look at each of these protocols in detail and discuss their benefits and drawbacks so you can make an informed decision about which one is the best fit for your company. So let’s get started!

Let’s first look at Authentication and Authorization.

Image from Authentication and Authorization | Okta

Authentication is the process of verifying that someone is who they claim to be. This typically involves a username and password but can also involve other methods such as biometric authentication (e.g., fingerprint or facial recognition).

Authorization is the process of granting authenticated users access to resources or performing actions. This is typically done through the use of permissions, which specify what a user is allowed to do. For example, a user with read-only permissions might be able to view files but not make changes to them.

In summary, authentication is the process of validating a user’s identification, whereas authorization is the process of allowing access to resources based on that identity.

OAuth, OpenId and SAML

In the early days of the internet, web applications and services were once difficult to protect. Users were required to remember many usernames and passwords, and application developers were required to create specific authentication and authorization codes for each service that they wanted to access.

Then came OAuth, a technology that transformed how online apps and services handled delegation of authorization. Users can offer third-party apps, access to their resources on another service using OAuth without disclosing their login credentials. This is made feasible by the use of access tokens, which reflect the user’s individual set of permissions.

Nevertheless, OAuth was not intended to be used for authentication, which is the act of authenticating a user’s identity. This is when OpenID comes into play. OpenID is a technology that allows users to use the same set of credentials to authenticate with numerous services. Users do not have to remember several usernames and passwords when using OpenID, and developers do not have to implement separate authentication codes for each service.

OpenID uses a token-based technique similar to OAuth; however, the token represents the user’s identity rather than access permission. This makes it simple for developers to include OpenID in their applications and services.

But what about authorization? Both OAuth and OpenID support delegated authorization, but what if you need to enable secure access to web applications and services across many organizations? This is where SAML comes into play. SAML stands for Security Assertion Markup Language.

SAML is a federated identity management protocol that is used for both authentication and authorization. With SAML, users may securely access web apps and services across several enterprises using a single set of credentials. This is made feasible by a browser-based SSO mechanism, in which the user is forwarded to an identity provider to authenticate and authorize access to the service provider.

In comparison to OAuth and OpenID, SAML offers a more comprehensive set of security features. Support for digital signatures, encryption, and attribute-based access control are all included. However, SAML is more difficult to install than OAuth and OpenID and therefore requires additional infrastructure.

OAuth vs. OpenID vs. SAML Differences

In summary, OAuth, OpenID, and SAML are all protocols intended to provide secure access to web applications and services, but their methods and capabilities differ. OAuth is used largely for delegated authorization, OpenID for authentication, and SAML for both authentication and authorization, particularly for federated identity management. Knowing these distinctions might assist companies in selecting the best protocol for their specific use cases and requirements.

And that’s the story of OAuth, OpenID, and SAML and how they relate to identity management. Thank you.

--

--

Prasad Lakshan
UCSC ISACA Student Group

Tech enthusiast, passionate about exploring opportunities to learn, teach, help, and take experiences. 🌐 https://howtocodes.com