Third-Party Token-based Authentication and Authorization for Session Initiation Protocol (SIP)
Avaya425 Legget DriveOttawaOntarioCanada+1-613-595-9106rifaat.ietf@gmail.comEricssonHirsalantie 11Jorvas 02420Finlandchrister.holmberg@ericsson.comwebrtchacksSpainvictor.pascual.avila@gmail.com
RAI
SIP CoreSIP OAuth3rd party authenticationThird party authentication
This document defines the "Bearer" authentication scheme for
the Session Initiation Protocol (SIP), and a mechanism by
which user authentication and SIP registration authorization
is delegated to a third party, using the OAuth 2.0 framework
and OpenID Connect Core 1.0. This document updates RFC 3261
to provide guidance on how a SIP User Agent Client (UAC)
responds to a SIP 401/407 response that contains multiple
WWW-Authenticate/Proxy-Authenticate header fields.
Introduction
The Session Initiation Protocol (SIP) uses the same framework
as HTTP to authenticate users: a simple
challenge-response authentication mechanism that allows a SIP server to challenge a
SIP client request and allows a SIP client to provide authentication
information in response to that challenge.
OAuth 2.0 defines a token-based authorization
framework to allow an OAuth client to access resources on behalf of its user.
The OpenID Connect 1.0 specification defines
a simple identity layer on top of the OAuth 2.0 protocol, which enables
clients to verify the identity of the user based on the authentication
performed by a dedicated authorization server, as well as to obtain basic
profile information about the user.
This document defines the "Bearer" authentication scheme for the
Session Initiation Protocol (SIP), and a mechanism by which user
authentication and SIP registration authorization is delegated to a
third party, using the OAuth 2.0 framework and OpenID Connect Core
1.0. This kind of user authentication enables the single-sign-on feature,
which allows the user to authenticate once and gain access to both SIP
and non-SIP services.
This document also updates , by defining the User Agent Client (UAC) procedures
when a UAC receives a 401/407 response with multiple WWW-Authenticate/Proxy-Authenticate
header fields, providing challenges using different authentication schemes
for the same realm.
Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
interpreted as described in BCP 14
when, and only when, they appear in all capitals, as shown here.
SIP User Agent Types
The OAuth 2.0 authorization framework defines two types of clients, confidential
and public, that apply to the SIP UACs.
Confidential User Agent: a SIP UAC that is capable of maintaining
the confidentiality of the user credentials and any tokens obtained
using these user credentials.
Public User Agent: a SIP UAC that is incapable of maintaining the
confidentiality of the user credentials and any obtained tokens.
The mechanism defined in this document MUST only be used with
Confidential User Agents, as the UAC is expected to obtain and maintain tokens
to be able to access the SIP network.
Token Types and Formats
The tokens used in third-party authorization depend on the type of
authorization server (AS).
An OAuth authorization server provides the following tokens to a successfully
authorized UAC:
Access token: the UAC will use this token to gain access to services by
providing the token to a SIP server.
Refresh token: the UAC will present this token to the AS
to refresh a stale access token.
An OpenID Connect server returns an additional token:
ID Token: this token contains the SIP URI and other
user-specific details that will be consumed by the UAC.
Tokens can be represented in two different formats:
Structured Token: a token that consists of a structured object that
contains the claims associated with the token, e.g. JWT as defined in .
Reference Token: a token that consists of a random string that is used
to obtain the details of the token and its associated claims, as defined in .
Access Tokens could be represented in one of the above two formats. Refresh Tokens
usualy are represented in a reference format, as this token is consumed only the AS that
issued the token. ID Token is defined as a structured token in the form of a JWT.
Example FlowsRegistration below shows an example of a SIP registration, where
the registrar informs the UAC about the authorization server from which the UAC can
obtain an access token in a 401 response
to the REGISTER request.
In step [1], the UAC starts the registration process by sending a
SIP REGISTER request to the registrar without any credentials.
In step [2], the registrar challenges the UA, by sending a SIP
401 (Unauthorized) response to the REGISTER request. In the response,
the registrar includes information about the AS to contact in order
to obtain a token.
In step [3], the UAC interacts with the AS via an out-of-scope mechanism, potentially using the OAuth Native
App mechanism defined in . The AS authenticates the user and provides the UAC with the
tokens needed to access the SIP service.
In step [4], the UAC retries the registration process by sending a new
REGISTER request that includes the access token that the UAC
obtained previously.
The registrar validates the access token. If the access token is a
reference token, the registrar MAY perform an introspection ,
as in steps [5] and [6], in order to obtain more information
about the access token and its scope, per .
Otherwise, after the registrar validates the token to make sure it was
signed by a trusted entity, it inspects its claims and acts upon it.
In step [7], once the registrar has successfully verified and accepted the
access token, it sends a 200 (OK) response to the REGISTER request.
Registration with Preconfigured AS shows an example of a SIP registration where
the UAC has been preconfigured with information about the AS
from which to obtain the access token.
In step [1], the UAC interacts with the AS using an out-of-scope mechanism, potentially using the OAuth Native
App mechanism defined in . The AS authenticates the user and provides the UAC with the
tokens needed to access the SIP service.
In step [2], the UAC initiates the registration process by sending a new
REGISTER request that includes the access token that the UAC
obtained previously.
The registrar validates the access token. If the access token is a
reference token, the registrar MAY perform an introspection,
as in steps [3] and [4], in order to obtain more information
about the access token and its scope, per .
Otherwise, after the registrar validates the token to make sure it was
signed by a trusted entity, it inspects its claims and acts upon it.
In step [5], once the registrar has successfully verified and accepted the
access token, it sends a 200 (OK) response to the REGISTER request.
SIP Procedures
Section 22 of defines the SIP procedures for the
Digest authentication mechanism. The same procedures apply to
the Bearer authentication mechanism, with the changes described in this section.
UAC BehaviorObtaining Tokens and Responding to Challenges
When a UAC sends a request without credentials (or with invalid credentials),
it could receive either a 401 (Unauthorized) response with a WWW-Authenticate header field or a 407 (Proxy
Authentication Required) response with a Proxy-Authenticate header field.
If the WWW-Authenticate or Proxy-Authenticate header field indicates "Bearer" scheme authentication
and contains an address to an authorization server, the UAC contacts the
authorization server in order to obtain tokens, and includes the requested
scopes, based on a local configuration ().
The detailed OAuth2 procedure to authenticate the user and obtain
these tokens is out of scope of this document.
The address of the authorization server might already be known to the UAC via configuration.
In which case, the UAC can contact the authorization server for tokens
before it sends a SIP request ().
Procedures for native applications are defined in .
When using the mechanism defined
in the user of the UAC will be directed to interact
with the authorization server using a web browser, allowing the authorization server
to prompt the user for multi-factor authentication, to redirect the user to
third-party identity providers, and to enable the use of single-sign-on sessions.
The tokens returned to
the UAC depend on the type of authorization server (AS): an OAuth AS provides an
access token and refresh token . The UAC provides the access token to the
SIP servers to authorize UAC's access to the service. The UAC uses the refresh token
only with the AS to get a new access token and refresh token before
the expiry of the current access token (see , section 1.5 Refresh Token for details).
An OpenID Connect server returns
an additional ID-Token containing the SIP URI and other user-specific
details that will be consumed by the UAC.
If the UAC receives a 401/407 response with multiple WWW-Authenticate/Proxy-Authenticate
header fields, providing challenges using different authentication schemes
for the same realm, the UAC provides credentials for one or more of the schemes
that it supports, based on local policy.
NOTE: The address of the Authorization Server might be known to the
UAC e.g., using means of configuration, in which case the UAC can
contact the Authorization Server in order to obtain the access token
before it sends SIP request without credentials.
Protecting the Access Token mandates that access tokens are protected with
TLS when in transit. However, TLS only guarantees hop-to-hop protection
when used to protect SIP signaling. Therefore the access token MUST be
protected in a way so that only authorized SIP servers will have access
to it. Endpoints that support this specification MUST support encrypted
JSON Web Tokens (JWT) for encoding and protecting
access tokens when they are included in SIP requests, unless some other mechanism
is used to guarantee that only authorized SIP endpoints have access to
the access token.
REGISTER Request
The procedures in this section apply when the UAC has received a challenge that contains a "Bearer" scheme, and the UAC has obtained a token as
specified in .
The UAC sends a REGISTER request with an Authorization header field containing
the response to the challenge, including the Bearer scheme carrying a valid
access token in the request, as specified in .
Note that, if there were multiple challenges with different schemes, then the UAC may be
able to successfully retry the request using non-Bearer credentials.
Based on local policy, the UAC MAY include an access token that has
been used for another binding associated with the same AOR in the
request.
If the access token included in a REGISTER request is not accepted,
and the UAC receives a 401 response or a 407 response, the UAC
follows the procedures in .
Non-REGISTER Request
The procedures in this section apply when the UAC has received a challenge that contains a "Bearer" scheme, and the UAC has obtained a token as
specified in .
When the UAC sends a request, it MUST include an Authorization header field
with a Bearer scheme, carrying a valid access token in the request, as specified
in . Based on local policy, the UAC MAY include
an access token that has been used for another dialog, or for another
stand-alone request, if the target of the new request is the same.
If the access token included in a request is not accepted, and the UAC receives
a 401 response or a 407 response, the UAC follows the procedures in
.
UAS and Registrar Behavior
When a UAS or Registrar receives a request that fails to contain
authorization credentials acceptable to it, it SHOULD challenge the
request by sending a 401 (Unauthorized) response. To indicate that
it is willing to accept an access token as a credential, the
UAS/Registrar MUST include a Proxy-Authentication header field in the
response that indicates "Bearer" scheme and includes an address of an
authorization server from which the originator can obtain an access token.
When a UAS/Registrar receives a SIP request that contains an Authorization
header field with an access token, the UAS/Registrar MUST validate the access
token, using the procedures associated with the type of access token (Structured
or Reference) used, e.g. .
If the token provided is an expired access token, then the UAS MUST reply with
401 Unauthorized, as defined in section 3 of .
If the validation is successful, the UAS/Registrar can continue to process
the request using normal SIP procedures. If the validation fails, the UAS/Registrar
MUST reject the request.
Proxy Behavior
When a proxy receives a request that fails to contain
authorization credentials acceptable to it, it SHOULD challenge the
request by sending a 407 (Proxy Authentication Required) response.
To indicate that it is willing to accept an access token as a
credential, the proxy MUST include a Proxy-Authentication
header field in the response that indicates "Bearer" scheme and
includes an address to an authorization server from which the
originator can obtain an access token.
When a proxy wishes to authenticate a received request, it MUST
search the request for Proxy-Authorization header fields with 'realm'
parameters that match its realm. It then MUST successfully validate
the credentials from at least one Proxy-Authorization header field
for its realm. When the scheme is "Bearer", the proxy MUST validate the
access token, using the procedures associated with the type of access
token (Structured or Reference) used, e.g., .
Access Token Claims
The type of services to which an access token grants access can be determined
using different methods. The methods used and the access provided by the token
is based on local policy agreed between the AS and the registrar.
If an access token is encoded as a JWT, it might contain a list of claims
, some registered and some application-specific. The
REGISTRAR can grant access to services based on such claims,
some other mechanism, or a combination of claims and some other mechanism.
If an access token is a reference token, the REGISTRAR will grant access
based on some other mechanism. Examples of such other mechanisms are
introspection , user profile lookups, etc.
WWW-Authenticate Response Header Field
This section uses ABNF to describe the syntax of the WWW-Authenticate header
field when used with the "Bearer" scheme to challenge the UAC for credentials,
by extending the 'challenge' parameter defined by .
The authz-server parameter contains the HTTPS URI, as defined in
, of the authorization server. The UAC can discover
metadata about the AS using a mechanism like the one defined in .
The realm and auth-param parameters are defined in .
Per , the realm string alone defines the protection
domain. states that the realm string must be
globally unique and recommends that the realm string contain a hostname or
domain name. It also states that the realm string should be a human-readable identifier
that can be rendered to the user.
The scope and error parameters are defined in .
The scope parameter could be used by the registrar/proxy to indicate to the UAC
the minimum scope that must be associated with the access token to be able to get
service. As defined in , the value of the scope parameter
is expressed as a list of space-delimited, case-sensitive strings. The strings are
defined by the authorization server. The values of the scope parameter are out of
scope of this document. The UAC will use the scope provided by the registrar to
contact the AS and obtain a proper token with the requested scope.
The error parameter could be used by the registrar/proxy to indicate to the UAC
the reason for the error, with possible values of "invalid_token" or "invalid_scope".
Security Considerations
The security considerations for OAuth are defined in .
The security considerations for bearer tokens are defined in .
The security considerations for JSON Web Tokens (JWT) are defined in .
These security considerations also apply to SIP usage of access token as defined in this
document.
mandates that access tokens are protected with TLS.
However, TLS only guarantees hop-to-hop protection when used to protect SIP
signaling. Therefore the access token MUST be protected in a way so that
only authorized SIP endpoints will have access to it. Endpoints that support
this specification MUST support encrypted JSON Web Tokens (JWT)
for encoding and protecting access tokens when included in SIP requests, unless
some other mechanism is used to guarantee that only authorized SIP endpoints
have access to the access token.
IANA ConsiderationsAcknowledgments
The authors would like to specially thank Paul Kyzivat for his multiple detailed reviews
and suggested text that significantly improved the quality of the document.
The authors would also like to thank the following for their review and
feedback on this document:
Olle Johansson, Roman Shpount, Dale Worley, and Jorgen Axell.
The authors would also like to thank the following for their review and
feedback of the original document that was replaced with this document:
Andrew Allen, Martin Dolly, Keith Drage, Paul Kyzivat, Jon Peterson,
Michael Procter, Roy Radhika, Matt Ryan, Ivo Sedlacek, Roman Shpount,
Robert Sparks, Asveren Tolga, Dale Worley, and Yehoshua Gev.
The authors would also like to specially thank Jean Mahoney for her multiple
reviews, editorial help, and the coversion of the XML source file from v2 to v3.
Normative ReferencesOpenID Connect Core 1.0