SAML Vs OAuth 2.0 Vs OpenID Connect PDF
SAML Vs OAuth 2.0 Vs OpenID Connect PDF
SAML Vs OAuth 2.0 Vs OpenID Connect PDF
2
T
he world of Identity and Access Management is ruled by two things -
Introduction acronyms and standards.
authorisation protocols - SAML2 and OAuth 2.0. This white paper extends that
H I S TO RY
Before diving into the details, it is useful to understand the order of emergence
of the various protocols. It helps follow the evolution that gave rise to OpenID
Connect.
2002
SAML 1.0
2003
SAML 1.1
2005
SAML 2.0
2006
OpenID 1.0
2007
OpenID 2.0
2010
OAuth 1.0
2012
OAuth 2.0
2014
OpenID Connect 1.0
3
Acronyms & Let’s recap on the terminology that will be needed as we start looking at the
uses to access a
web application
identities and
credentials
permission
to proceed
or access a
resource
being accessed
A P P L I C AT I O N S A N D P R O T E C T E D A P I S
and credentials
protected API
4
ACRONYMS
OP OpenID Provider
SP Service Provider
RP Relying Party
AS Authorisation Server
Protocols OpenID was the first mainstream standard for authentication. It is, however, now
obsolete following the approval of OpenID Connect. OpenID 2.0 was widely used
attributes.
Today when ‘OpenID’ is being talked about, it will almost always refer to OpenID
Connect 1.0.
5
OAUTH 2.0
Client initiates by
1 directing User Agent to
authorisation endpoint
1
2
Authorisation server
Authentication as authenticates the
required 2 resource owner using
appropriate method
Authorisation code
returned to Client 3
Client requests
4 access token from
authorisation server
Authorisation server
validates the Client and 5
returns token
1. The client initiates the flow by directing the resource owner’s user agent
authorisation server will send the user-agent back once access is granted (or
denied).
2. The authorisation server authenticates the resource owner (via the user-
agent) and establishes whether the resource owner grants or denies the
redirects the user-agent back to the client using the redirection URI provided
earlier (in the request or during client registration). The redirection URI
includes an authorisation code and any local state provided by the client
earlier.
6
4. The client requests an access token from the authorisation server’s token
When making the request, the client authenticates with the authorisation
server. The client includes the redirection URI used to obtain the
code, and ensures that the redirection URI received matches the URI used to
redirect the client in step (C). If valid, the authorisation server responds back
Authentication is all about the user in the context of the application, and a
the current user is and whether or not the user is present. In addition, the
However, OAuth 2.0 tells the application none of those things. OAuth 2.0 tells it
absolutely nothing about the user’s identity, nor does it expose how the end user
proved their presence or even if the user is still present or not. An OAuth 2.0
client asked for a token, received a token, and used that token to access some
This delegated access, accessing a resource on the behalf of a user who may
not even be present, is one of the great points of OAuth 2.0 and great for client
authorisation. At the same time, it is very limited for authentication, where the
whole point is figuring who the user is, how the user’s identity was authenticated
The authorisation code grant type is used to obtain both access tokens and
refresh tokens and is optimised for confidential clients. Since this is a redirection-
based flow, the client must be capable of interacting with the resource owner’s
Note: the lines illustrating steps 1, 2, and 3 are broken into two parts as they
7
SAML 2.0
authorisation assertions).
1. The Client attempts to access a secured resource via the User Agent, without
a security context.
provider for the authentication request protocol. The means by which this is
method.
8
5. The Identity Provider issues a <Response> message to be delivered by the
User Agent to the Service Provider. The message may indicate an error, or
6. Having received the response from the Identity Provider, the Service
Provider can respond to the Client’s User Agent with its own error, or can
establish its own security context for the Clienty and return the requested
resource.
This flow is HTTP POST heavy, rending it only really useful for interactive web
sessions.
was created with extensibility in mind. This extensibility allows new protocols to
A number of extension protocols have been defined (for example UMA) and a
to provide: “authentication built on top of OAuth 2.0 and the use of claims to
1 http://openid.net/developers/specs/
OpenID Connect, or OIDC for short, layers on top of OAuth 2.0 to provide
use of Claims.
Being based on OAuth2.0, OpenID Connect flow is very similar to OAuth 2.0 (as
9
Resource Authorisation
Client
Owner Server
Authorisation Server
authenticates the end user
3
Authorisation code
returned to Client
5
Client requests IDToken 6
Authorisation server
validates the code and
7
returns token
8 Client extracts subject identifier
request parameters.
5. The Authorisation Server sends the user back to the client with an access
6. The client requests a response using the Authorisation Code at the Token
endpoint.
7. The client receives a response that contains an ID Token and Access Token
8. The client validates the ID token and retrieves the subject identifier of the
user.
10
The OpenID Connect standard introduces additional parameters to the request
Feature Details
Additional parameters When the Client makes a request to the IdP it
Again, being based on OAuth 2.0 OpenID Connect is ‘API friendly’ and can be
Security SAML
Considerations For SAML the most common and widely used protocol for securing message
exchange between an IdP and service provider is sending signed SAML Assertion
to the Service Provider using HTTP POST protocol. SAML uses XML Signature and
Key exchange in SAML happens either out of band or dynamically with SAML
Metadata.
11
See SAML V2.0 Implementation Profile for Federation Interoperability for
implementation.
OIDC defines different profiles for securing message exchange between an IdP
The simplest model completely relies on security of DNS and TLS for integrity.
The benefit is a very low barrier of entry into integrating an application with
an OIDC IdP where the application designer only needs capability of invoking
cryptography is necessary.
When signed and encrypted JWTs are used, key exchange in OIDC happens
automated management of Client identities at an OIDC IdP - very well suited for
See OAuth 2.0 Threat Model and Security Considerations and OAuth 2.0 Security
Best Current Practice for recent instructions and best practices into creating
12
Firstly, OAuth 2.0 has a different purpose to both SAML 2.0 and OpenID Connect
Comparing the 1.0, OAuth is, at the base level, an authorisation protocol, whereas SAML and
Protocols OpenID Connect are authentication/authorisation protocols.
based on OAuth has a very low barrier to entry and can be scaled once working
If you are looking to join large existing federations then SAML will have the edge,
its age means many of the existing federations are SAML based (for example,
protocols. Doing this manually is a significant amount of work, but if you’re using
the Ubisecure Identity Server in an IdP Proxy role this is just a configuration
flexible model which can scale. SAML benefits from being within the browser
and having a relatively fixed security model, but is also only as secure as the
browser. OAuth is dependent upon the TLS stack and, when incorporated in an
application, is only as good as the stack in the application. If the app is using
implementation will need to take care over stack selection and configuration.
13
Conclusions The emergence and rapid growth of OpenID Connect is a physical manifestation
split between the traditional enterprise SSO and external user centric CIAM,
so has the protocol stack underneath. OpenID Connect combines OAuth 2.0
An inevitable question is “Which of the protocols is the right for my use case?”
Making broad generalisations is one of the best ways to draw dissension from all
If you are reading this to determine how to quantify, manage and reap the
you through the complexity and reduce your implementation time considerably.
www.ubisecure.com
14
Ubisecure is a pioneering European b2b and b2c Customer Identity & Access
About Ubisecure Management (CIAM) software provider and cloud identity services enabler
dedicated to helping its customers realise the true potential of digital business.
API tooling to help connect and enrich strong identity profiles; manage identity
consolidate identity, privacy and consent data; and streamline identity based
connects digital services and Identity Providers, such as social networks, mobile
networks, banks and governments, to allow Service Providers to use rich, verified
while improving privacy and consent around personal data sharing to meet
issue Legal Entity Identifiers (LEI) under its RapidLEI brand, a cloud-based service
that automates the LEI lifecycle to deliver LEIs quickly and easily. The company
[email protected] UK: +44 1273 957 613 FI: +358 9 251 77250 SE: +46 70 603 34 83