draft-ietf-sipcore-sip-token-authnz-13.txt   draft-ietf-sipcore-sip-token-authnz-14.txt 
SIP Core R. Shekh-Yusef SIP Core R. Shekh-Yusef
Internet-Draft Avaya Internet-Draft Avaya
Updates: 3261 (if approved) C. Holmberg Updates: 3261 (if approved) C. Holmberg
Intended status: Standards Track Ericsson Intended status: Standards Track Ericsson
Expires: 17 October 2020 V. Pascual Expires: 1 November 2020 V. Pascual
webrtchacks webrtchacks
15 April 2020 30 April 2020
Third-Party Token-based Authentication and Authorization for Session Third-Party Token-based Authentication and Authorization for Session
Initiation Protocol (SIP) Initiation Protocol (SIP)
draft-ietf-sipcore-sip-token-authnz-13 draft-ietf-sipcore-sip-token-authnz-14
Abstract Abstract
This document defines the "Bearer" authentication scheme for the This document defines the "Bearer" authentication scheme for the
Session Initiation Protocol (SIP), and a mechanism by which user Session Initiation Protocol (SIP), and a mechanism by which user
authentication and SIP registration authorization is delegated to a authentication and SIP registration authorization is delegated to a
third party, using the OAuth 2.0 framework and OpenID Connect Core 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 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 User Agent Client (UAC) responds to a SIP 401/407 response that
contains multiple WWW-Authenticate/Proxy-Authenticate header fields. contains multiple WWW-Authenticate/Proxy-Authenticate header fields.
skipping to change at page 1, line 40 skipping to change at page 1, line 40
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 17 October 2020. This Internet-Draft will expire on 1 November 2020.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. SIP User Agent Types . . . . . . . . . . . . . . . . . . 3 1.2. Applicability . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Token Types and Formats . . . . . . . . . . . . . . . . . 3 1.3. Token Types and Formats . . . . . . . . . . . . . . . . . 3
1.4. Example Flows . . . . . . . . . . . . . . . . . . . . . . 4 1.4. Example Flows . . . . . . . . . . . . . . . . . . . . . . 4
1.4.1. Registration . . . . . . . . . . . . . . . . . . . . 4 1.4.1. Registration . . . . . . . . . . . . . . . . . . . . 4
1.4.2. Registration with Preconfigured AS . . . . . . . . . 6 1.4.2. Registration with Preconfigured AS . . . . . . . . . 6
2. SIP Procedures . . . . . . . . . . . . . . . . . . . . . . . 7 2. SIP Procedures . . . . . . . . . . . . . . . . . . . . . . . 7
2.1. UAC Behavior . . . . . . . . . . . . . . . . . . . . . . 7 2.1. UAC Behavior . . . . . . . . . . . . . . . . . . . . . . 7
2.1.1. Obtaining Tokens and Responding to Challenges . . . . 7 2.1.1. Obtaining Tokens and Responding to Challenges . . . . 7
2.1.2. Protecting the Access Token . . . . . . . . . . . . . 8 2.1.2. Protecting the Access Token . . . . . . . . . . . . . 9
2.1.3. REGISTER Request . . . . . . . . . . . . . . . . . . 8 2.1.3. REGISTER Request . . . . . . . . . . . . . . . . . . 9
2.1.4. Non-REGISTER Request . . . . . . . . . . . . . . . . 9 2.1.4. Non-REGISTER Request . . . . . . . . . . . . . . . . 9
2.2. UAS and Registrar Behavior . . . . . . . . . . . . . . . 9 2.2. User Agent Server (UAS) and Registrar Behavior . . . . . 10
2.3. Proxy Behavior . . . . . . . . . . . . . . . . . . . . . 10 2.3. Proxy Behavior . . . . . . . . . . . . . . . . . . . . . 10
3. Access Token Claims . . . . . . . . . . . . . . . . . . . . . 10 3. Access Token Claims . . . . . . . . . . . . . . . . . . . . . 11
4. WWW-Authenticate Response Header Field . . . . . . . . . . . 10 4. WWW-Authenticate Response Header Field . . . . . . . . . . . 11
5. Security Considerations . . . . . . . . . . . . . . . . . . . 12 5. Security Considerations . . . . . . . . . . . . . . . . . . . 12
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13
7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 12 6.1. New Proxy-Authenticate header field parameters . . . . . 14
8. Normative References . . . . . . . . . . . . . . . . . . . . 13 6.2. New WWW-Authenticate header field parameters . . . . . . 14
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 15
8. Normative References . . . . . . . . . . . . . . . . . . . . 15
9. Informative References . . . . . . . . . . . . . . . . . . . 16
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 16
1. Introduction 1. Introduction
The Session Initiation Protocol (SIP) [RFC3261] uses the same The Session Initiation Protocol (SIP) [RFC3261] uses the same
framework as HTTP [RFC7230] to authenticate users: a simple framework as HTTP [RFC7230] to authenticate users: a simple
challenge-response authentication mechanism that allows a SIP server challenge-response authentication mechanism that allows a SIP User
to challenge a SIP client request and allows a SIP client to provide Agent Server (UAS), proxy or registrar to challenge a SIP User Agent
authentication information in response to that challenge. Client (UAC) request and allows the UAC to provide authentication
information in response to that challenge.
OAuth 2.0 [RFC6749] defines a token-based authorization framework to OAuth 2.0 [RFC6749] defines a token-based authorization framework to
allow an OAuth client to access resources on behalf of its user. allow an OAuth client to access resources on behalf of its user.
The OpenID Connect 1.0 specification [OPENID] defines a simple The OpenID Connect 1.0 specification [OPENID] defines a simple
identity layer on top of the OAuth 2.0 protocol, which enables identity layer on top of the OAuth 2.0 protocol, which enables OAuth/
clients to verify the identity of the user based on the OpenID clients to verify the identity of the user based on the
authentication performed by a dedicated authorization server, as well authentication performed by a dedicated authorization server (AS),
as to obtain basic profile information about the user. referred to as OpenID Provider (OP), as well as to obtain basic
profile information about the user.
This document defines the "Bearer" authentication scheme for the This document defines the "Bearer" authentication scheme for the
Session Initiation Protocol (SIP), and a mechanism by which user Session Initiation Protocol (SIP), and a mechanism by which user
authentication and SIP registration authorization is delegated to a authentication and SIP registration authorization is delegated to a
third party, using the OAuth 2.0 framework and OpenID Connect Core third party, using the OAuth 2.0 framework and OpenID Connect Core
1.0. This kind of user authentication enables single sign-on, which 1.0. This kind of user authentication enables single sign-on, which
allows the user to authenticate once and gain access to both SIP and allows the user to authenticate once and gain access to both SIP and
non-SIP services. non-SIP services.
This document also updates [RFC3261], by defining the User Agent This document also updates [RFC3261], by defining the UAC procedures
Client (UAC) procedures when a UAC receives a 401/407 response with when a UAC receives a 401/407 response with multiple WWW-
multiple WWW-Authenticate/Proxy-Authenticate header fields, providing Authenticate/Proxy-Authenticate header fields, providing challenges
challenges using different authentication schemes for the same realm. using different authentication schemes for the same realm.
1.1. Terminology 1.1. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
document are to be interpreted as described in BCP 14 [RFC2119] "OPTIONAL" in this document are to be interpreted as described in BCP
[RFC8174] when, and only when, they appear in all capitals, as shown 14 [RFC2119] [RFC8174] when, and only when, they appear in all
here. capitals, as shown here.
1.2. SIP User Agent Types
The OAuth 2.0 authorization framework [RFC6749] 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 1.2. Applicability
confidentiality of the user credentials and any obtained tokens.
The mechanism defined in this document MUST only be used with This document covers cases where grants that allow the UAC to obtain
Confidential User Agents, as the UAC is expected to obtain and an access token from the AS are used. Cases where the UAC is not
maintain tokens to be able to access the SIP network. able to obtain an access token (e.g., in the case of an authorization
code grant) are not covered.
1.3. Token Types and Formats 1.3. Token Types and Formats
The tokens used in third-party authorization depend on the type of The tokens used in third-party authorization depend on the type of
authorization server (AS). AS.
An OAuth authorization server provides the following tokens to a An OAuth AS provides the following tokens to a successfully
successfully authorized UAC: authorized UAC:
* Access token: the UAC will use this token to gain access to * Access token: the UAC will use this token to gain access to
services by providing the token to a SIP server. services by providing the token to a SIP server.
* Refresh token: the UAC will present this token to the AS to * Refresh token: the UAC will present this token to the AS to
refresh a stale access token. refresh a stale access token.
An OpenID Connect server returns an additional token: An OP returns an additional token:
* ID Token: this token contains the SIP URI and other user-specific * ID Token: this token contains a SIP URI associated with the user
details that will be consumed by the UAC. and other user-specific details that will be consumed by the UAC.
Tokens can be represented in two different formats: Tokens can be represented in two different formats:
* Structured Token: a token that consists of a structured object * Structured Token: a token that consists of a structured object
that contains the claims associated with the token, e.g. JWT as that contains the claims associated with the token, e.g., JSON Web
defined in [RFC7519]. Token (JWT) as defined in [RFC7519].
* Reference Token: a token that consists of a random string that is * Reference Token: a token that consists of an opaque string that is
used to obtain the details of the token and its associated claims, used to obtain the details of the token and its associated claims,
as defined in [RFC6749]. as defined in [RFC6749].
Access Tokens could be represented in one of the above two formats. Access Tokens are represented in one of the above two formats.
Refresh Tokens usualy are represented in a reference format, as this Refresh Tokens usually are represented in a reference format, as this
token is consumed only the AS that issued the token. ID Token is token is consumed only the AS that issued the token. ID Token is
defined as a structured token in the form of a JWT. defined as a structured token in the form of a JWT.
1.4. Example Flows 1.4. Example Flows
1.4.1. Registration 1.4.1. Registration
Figure 1 below shows an example of a SIP registration, where the Figure 1 below shows an example of a SIP registration, where the
registrar informs the UAC about the authorization server from which registrar informs the UAC about the AS from which the UAC can obtain
the UAC can obtain an access token. an access token.
UAC Registrar AS UAC Registrar AS/OP
--------------------------------------------------------------------- ---------------------------------------------------------------------
| | | | | |
| [1] REGISTER | | | [1] REGISTER | |
|------------------------------>| | |------------------------------>| |
| | | | | |
| [2] 401 Unauthorized | | | [2] 401 Unauthorized | |
| WWW-Authenticate: Bearer "authz_server"="<authz_server>" | | WWW-Authenticate: Bearer "authz_server"="<authz_server>" |
|<------------------------------| | |<------------------------------| |
| | | | | |
| [3] The UAC interacts with the AS and obtains tokens, using | | [3] The UAC interacts with the AS and obtains tokens, using |
| some out-of-scope mechanism. | | some out-of-scope mechanism. |
|<=============================================================>| |<=============================================================>|
| | | | | |
| [4] REGISTER | | | [4] REGISTER | |
| Authorization: Bearer <access_token> | | Authorization: Bearer <access_token> |
|------------------------------>| | |------------------------------>| |
| | [5] HTTP POST /introspect | | | [5] HTTP POST /introspect |
| | {access_token} | | | {access_token} |
| | (OPTIONAL) |
| |------------------------------>| | |------------------------------>|
| | | | | |
| | [6] 200 OK {metadata} | | | [6] 200 OK {metadata} |
| | (OPTIONAL) |
| |<------------------------------| | |<------------------------------|
| | | | | |
| [7] 200 OK | | | [7] 200 OK | |
|<------------------------------| | |<------------------------------| |
| | | | | |
Figure 1: Example Registration Flow Figure 1: Example Registration Flow
In step [1], the UAC starts the registration process by sending a SIP In step [1], the UAC starts the registration process by sending a SIP
REGISTER request to the registrar without any credentials. REGISTER request to the registrar without any credentials.
skipping to change at page 6, line 9 skipping to change at page 6, line 9
with the tokens needed to access the SIP service. with the tokens needed to access the SIP service.
In step [4], the UAC retries the registration process by sending a In step [4], the UAC retries the registration process by sending a
new REGISTER request that includes the access token that the UAC new REGISTER request that includes the access token that the UAC
obtained in the step above. obtained in the step above.
The registrar validates the access token. If the access token is a The registrar validates the access token. If the access token is a
reference token, the registrar MAY perform an introspection reference token, the registrar MAY perform an introspection
[RFC7662], as in steps [5] and [6], in order to obtain more [RFC7662], as in steps [5] and [6], in order to obtain more
information about the access token and its scope, per [RFC7662]. information about the access token and its scope, per [RFC7662].
Otherwise, after the registrar validates the token to make sure it Otherwise, after the registrar validates the token, it inspects its
was signed by a trusted entity, it inspects its claims and acts upon claims and acts upon it.
it.
In step [7], once the registrar has successfully verified and In step [7], once the registrar has successfully verified and
accepted the access token, it sends a 200 (OK) response to the accepted the access token, it sends a 200 (OK) response to the
REGISTER request. REGISTER request.
1.4.2. Registration with Preconfigured AS 1.4.2. Registration with Preconfigured AS
Figure 2 shows an example of a SIP registration where the UAC has Figure 2 shows an example of a SIP registration where the UAC has
been preconfigured with information about the AS from which to obtain been preconfigured with information about the AS from which to obtain
the access token. the access token.
UAC Registrar AS UAC Registrar AS/OP
--------------------------------------------------------------------- ---------------------------------------------------------------------
| | | | | |
| [1] The UAC interacts with the AS and obtains tokens, using | | [1] The UAC interacts with the AS and obtains tokens, using |
| some out of scope mechanism. | | some out of scope mechanism. |
|<=============================================================>| |<=============================================================>|
| | | | | |
| [2] REGISTER | | | [2] REGISTER | |
| Authorization: Bearer <access_token> | | Authorization: Bearer <access_token> |
|------------------------------>| | |------------------------------>| |
| | [3] HTTP POST /introspect | | | [3] HTTP POST /introspect |
| | {access_token} | | | {access_token} |
| | (OPTIONAL) |
| |------------------------------>| | |------------------------------>|
| | | | | |
| | [4] 200 OK {metadata} | | | [4] 200 OK {metadata} |
| | (OPTIONAL) |
| |<------------------------------| | |<------------------------------|
| | | | | |
| [5] 200 OK | | | [5] 200 OK | |
|<------------------------------| | |<------------------------------| |
| | | | | |
Figure 2: Example Registration Flow - Authorization Server Figure 2: Example Registration Flow - AS Information Preconfigured
Information Preconfigured
In step [1], the UAC interacts with the AS using an out-of-scope In step [1], the UAC interacts with the AS using an out-of-scope
mechanism, potentially using the OAuth Native App mechanism defined mechanism, potentially using the OAuth Native App mechanism defined
in [RFC8252]. The AS authenticates the user and provides the UAC in [RFC8252]. The AS authenticates the user and provides the UAC
with the tokens needed to access the SIP service. with the tokens needed to access the SIP service.
In step [2], the UAC initiates the registration process by sending a In step [2], the UAC initiates the registration process by sending a
new REGISTER request that includes the access token that the UAC new REGISTER request that includes the access token that the UAC
obtained in the step above. obtained in the step above.
The registrar validates the access token. If the access token is a The registrar validates the access token. If the access token is a
reference token, the registrar MAY perform an introspection, as in reference token, the registrar MAY perform an introspection
steps [3] and [4], in order to obtain more information about the [RFC7662], as in steps [4] and [5], in order to obtain more
access token and its scope, per [RFC7662]. Otherwise, after the information about the access token and its scope, per [RFC7662].
registrar validates the token to make sure it was signed by a trusted Otherwise, after the registrar validates the token, it inspects its
entity, it inspects its claims and acts upon it. claims and acts upon it.
In step [5], once the registrar has successfully verified and In step [5], once the registrar has successfully verified and
accepted the access token, it sends a 200 (OK) response to the accepted the access token, it sends a 200 (OK) response to the
REGISTER request. REGISTER request.
2. SIP Procedures 2. SIP Procedures
Section 22 of [RFC3261] defines the SIP procedures for the Digest Section 22 of [RFC3261] defines the SIP procedures for the Digest
authentication mechanism. The same procedures apply to the Bearer authentication mechanism. The same procedures apply to the Bearer
authentication mechanism, with the changes described in this section. authentication mechanism, with the changes described in this section.
2.1. UAC Behavior 2.1. UAC Behavior
2.1.1. Obtaining Tokens and Responding to Challenges 2.1.1. Obtaining Tokens and Responding to Challenges
When a UAC sends a request without credentials (or with invalid When a UAC sends a request without credentials (or with invalid
credentials), it could receive either a 401 (Unauthorized) response credentials), it could receive either a 401 (Unauthorized) response
with a WWW-Authenticate header field or a 407 (Proxy Authentication with a WWW-Authenticate header field or a 407 (Proxy Authentication
Required) response with a Proxy-Authenticate header field. If the Required) response with a Proxy-Authenticate header field. If the
WWW-Authenticate or Proxy-Authenticate header field indicates WWW-Authenticate or Proxy-Authenticate header field indicates
"Bearer" scheme authentication and contains an address to an "Bearer" scheme authentication and contains an address to an AS, the
authorization server, the UAC contacts the authorization server in UAC contacts the AS in order to obtain tokens, and includes the
order to obtain tokens, and includes the requested scopes, based on a requested scopes, based on a local configuration (Figure 1). The UAC
local configuration (Figure 1). MUST check the AS URL received in the 401/407 response against a list
of trusted ASs configured on the UAC, in order to prevent several
classes of possible vulnerabilities when a client blindly attempt to
use any provided authorization.
The detailed OAuth2 procedure to authenticate the user and obtain The detailed OAuth2 procedure to authenticate the user and obtain
these tokens is out of scope of this document. The address of the these tokens is out of scope of this document. The address of the AS
authorization server might already be known to the UAC via might already be known to the UAC via configuration. In such cases,
configuration. In which case, the UAC can contact the authorization the UAC can contact the AS for tokens before it sends a SIP request
server for tokens before it sends a SIP request (Figure 2). (Figure 2). Procedures for native applications are defined in
Procedures for native applications are defined in [RFC8252]. When [RFC8252]. When using the mechanism defined in [RFC8252] the user of
using the mechanism defined in [RFC8252] the user of the UAC will be the UAC will be directed to interact with the AS using a web browser,
directed to interact with the authorization server using a web allowing the AS to prompt the user for multi-factor authentication,
browser, allowing the authorization server to prompt the user for to redirect the user to third-party identity providers, and to enable
multi-factor authentication, to redirect the user to third-party the use of single sign-on sessions.
identity providers, and to enable the use of single sign-on sessions.
The tokens returned to the UAC depend on the type of authorization The tokens returned to the UAC depend on the type of AS: an OAuth AS
server (AS): an OAuth AS provides an access token and refresh token provides an access token and optionally a refresh token [RFC6749].
[RFC6749]. The UAC provides the access token to the SIP servers to The refresh token is only used between the UAC and the AS. If the AS
authorize UAC's access to the service. The UAC uses the refresh provides a refresh token to the UAC, the UAC uses it to to request a
token only with the AS to get a new access token and refresh token new access token and refresh token from the AS before the currently
before the expiry of the current access token (see [RFC6749], section used access token expires token ([RFC6749], Section 1.5). If the AS
1.5 Refresh Token for details). An OpenID Connect server returns an does not provide a refresh token, the UAC needs to re-authenticate
additional ID-Token containing the SIP URI and other user-specific the user, in order to get a new access token, before the currently
details that will be consumed by the UAC. used access token expires. An OP returns an additional ID Token that
contains claims about the authentication of the user by an
authorization server. The ID Token can potentially include other
optional claims about the user, e.g. the SIP URI, that will be
consumed by the UAC and later used to register with the registrar.
If the UAC receives a 401/407 response with multiple WWW- If the UAC receives a 401/407 response with multiple WWW-
Authenticate/Proxy-Authenticate header fields, providing challenges Authenticate/Proxy-Authenticate header fields, providing challenges
using different authentication schemes for the same realm, the UAC using different authentication schemes for the same realm, the UAC
selects one or more of the provided schemes (based on local policy) provides credentials for one of the schemes that it supports, based
and provides credentials for those schemes. on local policy.
NOTE: The address of the Authorization Server might be known to the NOTE: At the time of writing this document, detailed procedures for
UAC e.g., using means of configuration, in which case the UAC can the cases where a UAC receives multiple different authentication
contact the Authorization Server in order to obtain the access token schemes had not been defined. A future specification might define
before it sends SIP request without credentials. such procedures.
NOTE: The address of the AS might be known to the UAC e.g., using
means of configuration, in which case the UAC can contact the AS in
order to obtain the access token before it sends SIP request without
credentials.
2.1.2. Protecting the Access Token 2.1.2. Protecting the Access Token
[RFC6749] mandates that access tokens are protected with TLS when in [RFC6749] mandates that access tokens are protected with TLS when in
transit. However, TLS only guarantees hop-to-hop protection when transit. However, SIP makes have use of intermediary SIP proxies,
used to protect SIP signaling. Therefore the access token MUST be and TLS only guarantees hop-to-hop protection when used to protect
protected in a way so that only authorized SIP servers will have SIP signaling. Therefore the access token MUST be protected in a way
access to it. Endpoints that support this specification MUST support so that only authorized SIP servers will have access to it. SIP
encrypted JSON Web Tokens (JWT) [RFC7519] for encoding and protecting endpoints that support this document MUST use encrypted JSON Web
access tokens when they are included in SIP requests, unless some Tokens (JWT) [RFC7519] for encoding and protecting access tokens when
other mechanism is used to guarantee that only authorized SIP they are included in SIP requests, unless some other mechanism is
endpoints have access to the access token. used to guarantee that only authorized SIP endpoints have access to
the access token. TLS can still be used for protecting traffic
between SIP endpoints and the AS.
2.1.3. REGISTER Request 2.1.3. REGISTER Request
The procedures in this section apply when the UAC has received a The procedures in this section apply when the UAC has received a
challenge that contains a "Bearer" scheme, and the UAC has obtained a challenge that contains a "Bearer" scheme, and the UAC has obtained a
token as specified in Section 2.1.1. token as specified in Section 2.1.1.
The UAC sends a REGISTER request with an Authorization header field The UAC sends a REGISTER request with an Authorization header field
containing the response to the challenge, including the Bearer scheme containing the response to the challenge, including the Bearer scheme
carrying a valid access token in the request, as specified in carrying a valid access token in the request, as specified in
[RFC6750]. [RFC6750].
Note that, if there were multiple challenges with different schemes, Note that, if there were multiple challenges with different schemes,
then the UAC may be able to successfully retry the request using non- then the UAC may be able to successfully retry the request using non-
Bearer credentials. Bearer credentials.
Based on local policy, the UAC MAY include an access token that has Typically, a UAC will obtain a new access token for each new binding,
been used for another binding associated with the same Address Of However, based on local policy, a UAC MAY include an access token
Record (AOR) in the request. that has been used for another binding associated with the same
Address Of Record (AOR) in the request.
If the access token included in a REGISTER request is not accepted, 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 and the UAC receives a 401 response or a 407 response, the UAC
follows the procedures in Section 2.1.1. follows the procedures in Section 2.1.1.
2.1.4. Non-REGISTER Request 2.1.4. Non-REGISTER Request
The procedures in this section apply when the UAC has received a The procedures in this section apply when the UAC has received a
challenge that contains a "Bearer" scheme, and the UAC has obtained a challenge that contains a "Bearer" scheme, and the UAC has obtained a
token as specified in Section 2.1.1. token as specified in Section 2.1.1.
When the UAC sends a request, it MUST include an Authorization header When the UAC sends a request, it MUST include an Authorization header
field with a Bearer scheme, carrying a valid access token in the field with a Bearer scheme, carrying a valid access token obtained
request, as specified in [RFC6750]. Based on local policy, the UAC from the AS indicated in the challenge, in the request, as specified
MAY include an access token that has been used for another dialog, or in [RFC6750]. Based on local policy, the UAC MAY include an access
for another stand-alone request, if the target of the new request is token that has been used for another dialog, or for another stand-
the same. 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 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 UAC receives a 401 response or a 407 response, the UAC follows the
procedures in Section 2.1.1. procedures in Section 2.1.1.
2.2. UAS and Registrar Behavior 2.2. User Agent Server (UAS) and Registrar Behavior
When a UAS or Registrar receives a request that fails to contain When a UAS or registrar receives a request that fails to contain
authorization credentials acceptable to it, it SHOULD challenge the authorization credentials acceptable to it, the UAS/registrar SHOULD
request by sending a 401 (Unauthorized) response. To indicate that challenge the request by sending a 401 (Unauthorized) response. If
it is willing to accept an access token as a credential, the UAS/ the UAS/registrar chooses to challenge the request, and is willing to
Registrar MUST include a Proxy-Authentication header field in the accept an access token as a credential, it MUST include a WWW-
response that indicates "Bearer" scheme and includes an address of an Authenticate header field in the response that indicates "Bearer"
authorization server from which the originator can obtain an access scheme and includes an AS address, encoded as an https URI [RFC7230],
token. from which the UAC can obtain an access token.
When a UAS/Registrar receives a SIP request that contains an When a UAS or registrar receives a SIP request that contains an
Authorization header field with an access token, the UAS/Registrar Authorization header field with an access token, the UAS/registrar
MUST validate the access token, using the procedures associated with MUST validate the access token, using the procedures associated with
the type of access token (Structured or Reference) used, e.g. the type of access token (Structured or Reference) used, e.g.,
[RFC7519]. If the token provided is an expired access token, then [RFC7519]. If the token provided is an expired access token, then
the UAS MUST reply with 401 Unauthorized, as defined in section 3 of the UAS/registrar MUST reply with a 401 (Unauthorized) response, as
[RFC6750]. If the validation is successful, the UAS/Registrar can defined in section 3 of [RFC6750]. If the validation is successful,
continue to process the request using normal SIP procedures. If the the UAS/registrar can continue to process the request using normal
validation fails, the UAS/Registrar MUST reject the request. SIP procedures. If the validation fails, the UAS/registrar MUST
reply with 401 (Unauthorized) response.
2.3. Proxy Behavior 2.3. Proxy Behavior
When a proxy receives a request that fails to contain authorization When a proxy receives a request that fails to contain authorization
credentials acceptable to it, it SHOULD challenge the request by credentials acceptable to it, it SHOULD challenge the request by
sending a 407 (Proxy Authentication Required) response. To indicate sending a 407 (Proxy Authentication Required) response. If the proxy
that it is willing to accept an access token as a credential, the chooses to challenge the request, and is willing to accept an access
proxy MUST include a Proxy-Authentication header field in the token as a credential, it MUST include a Proxy-Authenticate header
response that indicates "Bearer" scheme and includes an address to an field in the response that indicates "Bearer" scheme and includes an
authorization server from which the originator can obtain an access AS address, encoded as an https URI [RFC7230], from which the UAC can
token. obtain an access token.
When a proxy wishes to authenticate a received request, it MUST When a proxy wishes to authenticate a received request, it MUST
search the request for Proxy-Authorization header fields with 'realm' search the request for Proxy-Authorization header fields with 'realm'
parameters that match its realm. It then MUST successfully validate parameters that match its realm. It then MUST successfully validate
the credentials from at least one Proxy-Authorization header field the credentials from at least one Proxy-Authorization header field
for its realm. When the scheme is "Bearer", the proxy MUST validate for its realm. When the scheme is "Bearer", the proxy MUST validate
the access token, using the procedures associated with the type of the access token, using the procedures associated with the type of
access token (Structured or Reference) used, e.g., [RFC7519]. access token (Structured or Reference) used, e.g., [RFC7519].
3. Access Token Claims 3. Access Token Claims
The type of services to which an access token grants access can be The type of services to which an access token grants access can be
determined using different methods. The methods used and the access determined using different methods. The methods used and the access
provided by the token is based on local policy agreed between the AS provided by the token are based on local policy agreed between the AS
and the registrar. and the registrar.
If an access token is encoded as a JWT, it might contain a list of If an access token is encoded as a JWT, it will contain a list of
claims [RFC7519], some registered and some application-specific. The claims [RFC7519], including both registered and application-specific
REGISTRAR can grant access to services based on such claims, some claimes. The registrar can grant access to services based on such
other mechanism, or a combination of claims and some other mechanism. claims, some other mechanism, or a combination of claims and some
If an access token is a reference token, the REGISTRAR will grant other mechanism. If an access token is a reference token, the
access based on some other mechanism. Examples of such other registrar will grant access based on some other mechanism. Examples
mechanisms are introspection [RFC7662], user profile lookups, etc. of such other mechanisms are introspection [RFC7662] and user profile
lookups.
4. WWW-Authenticate Response Header Field 4. WWW-Authenticate Response Header Field
This section uses ABNF [RFC5234] to describe the syntax of the WWW- This section uses ABNF [RFC5234] to describe the syntax of the WWW-
Authenticate header field when used with the "Bearer" scheme to Authenticate header field when used with the "Bearer" scheme to
challenge the UAC for credentials, by extending the 'challenge' challenge the UAC for credentials, by extending the 'challenge'
parameter defined by [RFC3261]. parameter defined by [RFC3261].
challenge =/ ("Bearer" LWS bearer-cln *(COMMA bearer-cln)) challenge =/ ("Bearer" LWS bearer-cln *(COMMA bearer-cln))
bearer-cln = realm / scope / authz-server / error / bearer-cln = realm / scope-param / authz-server-param / error-param /
auth-param auth-param
authz-server = "authz_server" EQUAL authz-server-value realm = <defined in RFC3261>
authz-server-value = https-URI scope-param = "scope" EQUAL DQUOTE scope DQUTE
realm = <defined in RFC3261> scope = <defined in RFC6749>
auth-param = <defined in RFC3261> authz-server-param = "authz_server" EQUAL DQUOTE authz-server DQUOTE
scope = <defined in RFC6749> authz-server = https-URI
error = <defined in RFC6749> https-URI = <defined in RFC7230>
https-URI = <defined in RFC7230> error-param = "error" EQUAL DQUOTE error DQUOTE
error = <defined in RFC6749>
auth-param = <defined in RFC3261>
Figure 3: Bearer Scheme Syntax Figure 3: Bearer Scheme Syntax
The authz-server parameter contains the HTTPS URI, as defined in The authz_server parameter contains the HTTPS URI, as defined in
[RFC7230], of the authorization server. The UAC can discover [RFC7230], of the AS. The UAC can discover metadata about the AS
metadata about the AS using a mechanism like the one defined in using a mechanism like the one defined in [RFC8414].
[RFC8414].
The realm and auth-param parameters are defined in [RFC3261]. The realm and auth-param parameters are defined in [RFC3261].
Per [RFC3261], the realm string alone defines the protection domain. Per [RFC3261], the realm string alone defines the protection domain.
[RFC3261] states that the realm string must be globally unique and [RFC3261] states that the realm string must be globally unique and
recommends that the realm string contain a hostname or domain name. recommends that the realm string contain a hostname or domain name.
It also states that the realm string should be a human-readable It also states that the realm string should be a human-readable
identifier that can be rendered to the user. identifier that can be rendered to the user.
The scope and error parameters are defined in [RFC6749]. The scope and error parameters are defined in [RFC6749].
The scope parameter could be used by the registrar/proxy to indicate The scope parameter can be used by the registrar/proxy to indicate to
to the UAC the minimum scope that must be associated with the access the UAC the minimum scope that must be associated with the access
token to be able to get service. As defined in [RFC6749], the value token to be able to get service. As defined in [RFC6749], the value
of the scope parameter is expressed as a list of space-delimited, of the scope parameter is expressed as a list of space-delimited,
case-sensitive strings. The strings are defined by the authorization case-sensitive strings. The strings are defined by the AS. The
server. The values of the scope parameter are out of scope of this values of the scope parameter are out of scope of this document. The
document. The UAC will use the scope provided by the registrar to UAC will use the scope provided by the registrar to contact the AS
contact the AS and obtain a proper token with the requested scope. and obtain a proper token with the requested scope.
The error parameter could be used by the registrar/proxy to indicate The error parameter could be used by the registrar/proxy to indicate
to the UAC the reason for the error, with possible values of to the UAC the reason for the error, with possible values of
"invalid_token" or "invalid_scope". "invalid_token" or "invalid_scope".
5. Security Considerations 5. Security Considerations
The security considerations for OAuth are defined in [RFC6749]. The The security considerations for OAuth are defined in [RFC6749]. The
security considerations for bearer tokens are defined in [RFC6750]. security considerations for bearer tokens are defined in [RFC6750].
The security considerations for JSON Web Tokens (JWT) are defined in The security considerations for JSON Web Tokens (JWT) are defined in
[RFC7519]. These security considerations also apply to SIP usage of [RFC7519]. These security considerations also apply to SIP usage of
access token as defined in this document. access token as defined in this document.
[RFC6749] mandates that access tokens are protected with TLS. [RFC6749] mandates that access tokens are protected with TLS when in
However, TLS only guarantees hop-to-hop protection when used to transit. However, SIP makes have use of intermediary SIP proxies,
protect SIP signaling. Therefore the access token MUST be protected and TLS only guarantees hop-to-hop protection when used to protect
in a way so that only authorized SIP endpoints will have access to SIP signaling. Therefore the access token MUST be protected in a way
it. Endpoints that support this specification MUST support encrypted so that only authorized SIP servers will have access to it. SIP
JSON Web Tokens (JWT) [RFC7519] for encoding and protecting access endpoints that support this document MUST use encrypted JSON Web
tokens when included in SIP requests, unless some other mechanism is Tokens (JWT) [RFC7519] 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 used to guarantee that only authorized SIP endpoints have access to
the access token. the access token. TLS can still be used for protecting traffic
between SIP endpoints and the AS.
Single Sign-On (SSO) enables the user to use one set of credentials
to authenticate once and gain access to multiple SIP and non-SIP
services using access token(s). If the SSO login is compromised,
that single point of compromise has a much broader effect than is the
case without SSO. Further, an attacker can often use a compromised
account to set up Single Sign-On for other services that the victim
has not established an account with, and sometimes can even switch a
dedicated account into Single-Sign-On mode, creating a still broader
attack.
Because of that, it is critical to make sure that extra security
measures be taken to safeguard credentials used for Single Sign-On.
Examples of such measures include long passphrase instead of a
password, enabling multi-factor factor authentication, and the use of
embedded browser when possible, as defined in [RFC8252].
Although this is out of scope for this document, it is important to
carefully consider the claims provided in the tokens used to access
these services to make sure of the privacy of the user accessing
these services. As mentioned above, this document calls for
encrypting JWT representing the access token.
It is important that both parties participating in SSO provide
mechanisms for users to sever the SSO relationship, so that it is
possible without undue difficulty to mitigate a compromise that has
already happened.
The operator of a Single-Sign-On authentication system has access to
private information about sites and services that their users log
into, and even, to some extent, about their usage patterns. It's
important to call these out in privacy disclosures and policies, and
to make sure that users can be aware of the tradeoffs between
convenience and privacy when they choose to use SSO.
When a registrar chooses to challenge a REGISTER request, if the
registrar can provide access to different levels of services, it is
RECOMMENDED that the registrar includes a scope in the response in
order to indicate the minimum scope needed to register and access
basic services. The access token might include an extended scope
that gives the user access to more advanced features beyond basic
services.
6. IANA Considerations 6. IANA Considerations
6.1. New Proxy-Authenticate header field parameters
This section defines new SIP header field parameters in the "Header
Field Parameters and Parameter Values" subregistry of the "Session
Initiation Protocol (SIP) Parameters" registry:
https://www.iana.org/assignments/sip-parameters
Header Field: Proxy-Authenticate
Parameter Name: authz_server
Predefined Values: No
Reference: RFC XXXX
Parameter Name: error
Predefined Values: No
Reference: RFC XXXX
Parameter Name: scope
Predefined Values: No
Reference: RFC XXXX
Figure 4
6.2. New WWW-Authenticate header field parameters
This section defines new SIP header field parameters in the "Header
Field Parameters and Parameter Values" subregistry of the "Session
Initiation Protocol (SIP) Parameters" registry:
https://www.iana.org/assignments/sip-parameters
Header Field: WWW-Authenticate
Parameter Name: authz_server
Predefined Values: No
Reference: RFC XXXX
Parameter Name: error
Predefined Values: No
Reference: RFC XXXX
Parameter Name: scope
Predefined Values: No
Reference: RFC XXXX
Figure 5
7. Acknowledgments 7. Acknowledgments
The authors would like to specially thank Paul Kyzivat for his The authors would like to specially thank Paul Kyzivat for his
multiple detailed reviews and suggested text that significantly multiple detailed reviews and suggested text that significantly
improved the quality of the document. improved the quality of the document.
The authors would also like to thank the following for their review The authors would also like to thank the following for their review
and feedback on this document: and feedback on this document:
Olle Johansson, Roman Shpount, Dale Worley, and Jorgen Axell. Olle Johansson, Roman Shpount, Dale Worley, and Jorgen Axell.
The authors would also like to thank the following for their review The authors would also like to thank the following for their review
and feedback of the original document that was replaced with this and feedback of the original document that was replaced with this
document: document:
Andrew Allen, Martin Dolly, Keith Drage, Paul Kyzivat, Jon Peterson, Andrew Allen, Martin Dolly, Keith Drage, Paul Kyzivat, Jon Peterson,
Michael Procter, Roy Radhika, Matt Ryan, Ivo Sedlacek, Roman Shpount, Michael Procter, Roy Radhika, Matt Ryan, Ivo Sedlacek, Roman Shpount,
Robert Sparks, Asveren Tolga, Dale Worley, and Yehoshua Gev. Robert Sparks, Asveren Tolga, Dale Worley, and Yehoshua Gev.
Roman Danyliw, Benjamin Kaduk, Erik Kline, Barry Leiba, Eric Vyncke
and Magnus Westerlund provided feedback and suggestions for
improvements as part of the IESG evaluation of the document.
The authors would also like to specially thank Jean Mahoney for her The authors would also like to specially thank Jean Mahoney for her
multiple reviews, editorial help, and the coversion of the XML source multiple reviews, editorial help, and the coversion of the XML source
file from v2 to v3. file from v2 to v3.
8. Normative References 8. Normative References
[OPENID] Sakimura, N., Bradley, J., Jones, M., de Medeiros, B., and [OPENID] Sakimura, N., Bradley, J., Jones, M., de Medeiros, B., and
C. Mortimore, "OpenID Connect Core 1.0", February 2014. C. Mortimore, "OpenID Connect Core 1.0", February 2014.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
skipping to change at page 14, line 5 skipping to change at page 16, line 36
<https://www.rfc-editor.org/info/rfc7519>. <https://www.rfc-editor.org/info/rfc7519>.
[RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection", [RFC7662] Richer, J., Ed., "OAuth 2.0 Token Introspection",
RFC 7662, DOI 10.17487/RFC7662, October 2015, RFC 7662, DOI 10.17487/RFC7662, October 2015,
<https://www.rfc-editor.org/info/rfc7662>. <https://www.rfc-editor.org/info/rfc7662>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
9. Informative References
[RFC8252] Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps", [RFC8252] Denniss, W. and J. Bradley, "OAuth 2.0 for Native Apps",
BCP 212, RFC 8252, DOI 10.17487/RFC8252, October 2017, BCP 212, RFC 8252, DOI 10.17487/RFC8252, October 2017,
<https://www.rfc-editor.org/info/rfc8252>. <https://www.rfc-editor.org/info/rfc8252>.
[RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0 [RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0
Authorization Server Metadata", RFC 8414, Authorization Server Metadata", RFC 8414,
DOI 10.17487/RFC8414, June 2018, DOI 10.17487/RFC8414, June 2018,
<https://www.rfc-editor.org/info/rfc8414>. <https://www.rfc-editor.org/info/rfc8414>.
Authors' Addresses Authors' Addresses
 End of changes. 57 change blocks. 
171 lines changed or deleted 281 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/