Renan Roggia
I consider myself a tech problem solver.
RFC7521 - Assertion Framework for OAuth 2.0 Client Authentication and Authorization Grants
[...] provides a framework for the use of assertions with OAuth 2.0 in the form of a new client authentication mechanism and a new authorization grant type.
[...] to provide a common framework for OAuth 2.0 to interwork with other identity systems using assertions and to provide alternative client authentication mechanism.
An assertion is a package of information that facilitates the sharing of identity and security information across security domains.
This specification provides two functionalities:
You'll also find:
[...] generic mechanisms for transporting assertions during interactions with an authorization server's token endpoint
[...] general rules for the content and processing of those assertions.
The intent behind adding this two functionalities are two:
Using the assertions as authorization grant is separable from using the assertion from client authentication. Each functionality can be used on its own.
Client assertion authentication is nothing more than an alternative way for a client to authenticate to the token endpoint.
Uses keywords as decribed in RFC 2119.
An assertion typically contains:
The entity that creates and signs or integrity-protects it is know as the "Issuer".
The entity that consumes the assertion is known the "Relying party". In the context of this document, the authorization server acts as a Relying party.
The issuer must protect the integrity of an assertion by applying a digital signature or a Message Authentication Code (MAC). Its intent is to identify the issuer and ensure the assertion's content integrity.
In addition, an assertion might be encrypted.
The specification doesn't define how the Client obtains the assertion, but it suggests two main ways:
The Client obtains an assertion from a third-party entity capable of issuing, renewing, transforming, and validating security tokens. This entity is known as "security token service" (STS) or just "token service".
A trust relationship exists between the STS and the relying party (authorization service).
The Client creates assertions locally.
Self-issued assertions can be used to demonstrate knowledge of some secret, such as a Client secret, without actually communicating the secret directly in the transaction.
In the point of view of the entity presenting the assertion, there are two types of assertion:
The scope of this specification only covers a Client presenting a bearer assertion to an authorization server.
Is mandatory to use HTTPS.
When using assertions as authorization grants, the client includes the assertion and related information using the following HTTP request parameters:
grant_type
: REQUIRED. The format of the assertion.assertion
: REQUIRED. The assertion being used as an authorization grant.scope
: OPTIONAL. The request scope must be equal or less than the scope originally granted to the authorized accessor.The authentication of the client is optional. Therefore, client_id
is only required when the client authentication relies on this parameter.
Example:
POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&
assertion={assertion-goes-here}
An assertion used in this context is a short lived representation of the authorization grant. The access token issued by authorization server should not have a lifespan way bigger than its assertion validity.
If an assertion is not valid or has expired the value of the error
parameter must be the invalid_grant
.
When using assertions as client credentials, the client includes the assertion and related information using the following HTTP request parameters:
client_assertion_type
: REQUIRED. The format of the assertion.client_assertion
: REQUIRED. The assertion being used to authenticate the client.client_id
: OPTIONAL. It's unnecessary, the client is already identified by the subject of the assertion. If specified, it must be the same as identified by the client assertion.Example:
POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&
code={{authorization_code_goes_here}}&
client_assertion_type=urn:ietf:params:oauth:client-assertion-type:saml2-bearer&
client_assertion={client_assertion-goes-here}
If an assertion is invalid for any reason or if more than one client authentication mechanism is used the value of the error
parameter must be the invalid_client
.
Provides general content and processing model for the use of assertions with OAuth 2.0.
The following are general terms abstract from any particular assertion format.
A unique identifier for the entity that issued the assertion. It holds the key material used to sign or integrity-protect the assertion. OAuth Clients (self-issued assertions) and STS are examples.
A unique identifier for the principal that is the subject of the assertion. Two possible interpretations:
client_id
.Identifies the party or parties intended to process the assertion. The URL of the token endpoint can be used to indicate the authorization server as a valid intended audience.
Time at which the assertion was issued. UTC format.
Time at which the assertion expires. UTC format.
An nonce or unique identifier for the assertion.
The assertion must contain:
A client uses an assertion to authenticate to the authorization server's token endpoint (as described in 4.2).
The assertion's Subject is the client.
If it's a self-issued assertion the assertion's Issuer is also the client.
A client is accessing resources on behalf of itself. Analogous to the Client Credentials Grant. It combines both the authentication an authorization grant usage patterns.
The interaction with the authorization server is treated as using an assertion for Client authentication (as described in 4.2), while using the client_credentials
as grant_type
to indicate that the client is requesting an access token for itself.
Example:
POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&
client_assertion_type=urn:ietf:params:oauth:client-assertion-type:saml2-bearer&
client_assertion={client_assertion-goes-here}
A client is accessing a resource on behalf of a user. It has to inform the assertion
as the grant_type
parameter (as described in 4.1). The Subject identifies an authorized accessor, typically the resource owner or an authorized delegate.
A client is accessing resources on behalf of an anonymous user. A mutually agree-upon Subject identifier indicating anonymity is used.
Authorization may be based upon additional criteria, such as additional attributes or claims provided in the assertion.
On its own, this specification is not sufficient to produce interoperable implementations.
The RFC 7522 and RFC 7523 specify additional details about assertions encoding and processing rules.
Specific items that require agreement are:
Threat: An adversary could forge or alter an assertion in order to obtain an acces token (as described in 4.1) or to impersonate a client (as described in 4.2).
Countermeasure: Apply mechanisms for protecting the integrity of the assertion (digital signature or MAC).
Threat: An adversary might obtain an assertion and then reuse it later in time.
Countermeasure: Use secure communication channels with server authentication for all network exchanges.
Threat: Other entities to obtain information about an individual (role in an organization, authentication information, ...)
Countermeasure: Use of TLS and encrypt assertion.
An assertion may contain privacy-sensitive information, therefore, use TLS and encrypt this information.
Register of assertion
, client_assertion
, client_assertion_type
.