idnits 2.17.1 draft-ietf-kitten-sasl-oauth-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 14, 2011) is 4540 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC5929' is defined on line 926, but no explicit reference was found in the text == Outdated reference: A later version (-31) exists of draft-ietf-oauth-v2-22 == Outdated reference: A later version (-23) exists of draft-ietf-oauth-v2-bearer-14 == Outdated reference: A later version (-05) exists of draft-ietf-oauth-v2-http-mac-00 ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) ** Downref: Normative reference to an Informational RFC: RFC 3174 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 5849 (Obsoleted by RFC 6749) ** Obsolete normative reference: RFC 5988 (Obsoleted by RFC 8288) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) == Outdated reference: A later version (-04) exists of draft-jones-simple-web-discovery-01 -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) Summary: 7 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 KITTEN W. Mills 3 Internet-Draft T. Showalter 4 Intended status: Standards Track Yahoo! Inc. 5 Expires: May 17, 2012 H. Tschofenig 6 Nokia Siemens Networks 7 November 14, 2011 9 A SASL and GSS-API Mechanism for OAuth 10 draft-ietf-kitten-sasl-oauth-00.txt 12 Abstract 14 OAuth enables a third-party application to obtain limited access to a 15 protected resource, either on behalf of a resource owner by 16 orchestrating an approval interaction, or by allowing the third-party 17 application to obtain access on its own behalf. 19 This document defines how an application client uses OAuth over the 20 Simple Authentication and Security Layer (SASL) or the Generic 21 Security Service Application Program Interface (GSS-API) to access a 22 protected resource at a resource serve, and additionally defines 23 authorization and token issuing endpoint discovery. Thereby, it 24 enables schemes defined within the OAuth framework for non-HTTP-based 25 application protocols. 27 Clients typically store the user's long term credential. This does, 28 however, lead to significant security vulnerabilities, for example, 29 when such a credential leaks. A significant benefit of OAuth for 30 usage in those clients is that the password is replaced by a token. 31 Tokens typically provided limited access rights and can be managed 32 and revoked separately from the user's long-term credential 33 (password). 35 Status of this Memo 37 This Internet-Draft is submitted in full conformance with the 38 provisions of BCP 78 and BCP 79. 40 Internet-Drafts are working documents of the Internet Engineering 41 Task Force (IETF). Note that other groups may also distribute 42 working documents as Internet-Drafts. The list of current Internet- 43 Drafts is at http://datatracker.ietf.org/drafts/current/. 45 Internet-Drafts are draft documents valid for a maximum of six months 46 and may be updated, replaced, or obsoleted by other documents at any 47 time. It is inappropriate to use Internet-Drafts as reference 48 material or to cite them other than as "work in progress." 49 This Internet-Draft will expire on May 17, 2012. 51 Copyright Notice 53 Copyright (c) 2011 IETF Trust and the persons identified as the 54 document authors. All rights reserved. 56 This document is subject to BCP 78 and the IETF Trust's Legal 57 Provisions Relating to IETF Documents 58 (http://trustee.ietf.org/license-info) in effect on the date of 59 publication of this document. Please review these documents 60 carefully, as they describe your rights and restrictions with respect 61 to this document. Code Components extracted from this document must 62 include Simplified BSD License text as described in Section 4.e of 63 the Trust Legal Provisions and are provided without warranty as 64 described in the Simplified BSD License. 66 Table of Contents 68 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 69 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 7 70 3. OAuth SASL Mechanism Specification . . . . . . . . . . . . . . 8 71 3.1. Channel Binding . . . . . . . . . . . . . . . . . . . . . 8 72 3.2. Initial Client Response . . . . . . . . . . . . . . . . . 8 73 3.2.1. Query String in OAUTH-PLUS . . . . . . . . . . . . . . 9 74 3.3. Server's Response . . . . . . . . . . . . . . . . . . . . 9 75 3.4. Mapping to SASL Identities . . . . . . . . . . . . . . . . 10 76 3.5. Discovery Information . . . . . . . . . . . . . . . . . . 10 77 3.6. Use of Signature Type Authorization . . . . . . . . . . . 12 78 4. GSS-API OAuth Mechanism Specification . . . . . . . . . . . . 14 79 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 80 5.1. Successful Bearer Token Exchange . . . . . . . . . . . . . 15 81 5.2. MAC Authentication with Channel Binding . . . . . . . . . 15 82 5.3. Failed Exchange . . . . . . . . . . . . . . . . . . . . . 16 83 5.4. Failed Channel Binding . . . . . . . . . . . . . . . . . . 17 84 6. Security Considerations . . . . . . . . . . . . . . . . . . . 18 85 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 86 7.1. SASL Registration . . . . . . . . . . . . . . . . . . . . 19 87 7.2. GSS-API Registration . . . . . . . . . . . . . . . . . . . 19 88 7.3. Link Type Registration . . . . . . . . . . . . . . . . . . 19 89 7.3.1. OAuth 2 Authentication Endpoint . . . . . . . . . . . 19 90 7.3.2. OAuth 2 Token Endpoint . . . . . . . . . . . . . . . . 20 91 7.3.3. OAuth 1.0a Request Initiation Endpoint . . . . . . . . 20 92 7.3.4. OAuth 1.0a Authorization Endpoint . . . . . . . . . . 21 93 7.3.5. OAuth 1.0a Token Endpoint . . . . . . . . . . . . . . 21 94 8. Appendix A -- Document History . . . . . . . . . . . . . . . . 22 95 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 23 96 9.1. Normative References . . . . . . . . . . . . . . . . . . . 23 97 9.2. Informative References . . . . . . . . . . . . . . . . . . 24 98 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 25 100 1. Introduction 102 OAuth [I-D.ietf-oauth-v2] enables a third-party application to obtain 103 limited access to a protected resource, either on behalf of a 104 resource owner by orchestrating an approval interaction, or by 105 allowing the third-party application to obtain access on its own 106 behalf. The core OAuth specification [I-D.ietf-oauth-v2] does not 107 define the interaction between the client and the resource server 108 with the access to a protected resource using an Access Token. This 109 functionality is described in two separate specifications, namely 110 [I-D.ietf-oauth-v2-bearer], and [I-D.ietf-oauth-v2-http-mac], whereby 111 the focus is on an HTTP-based environment only. 113 Figure 1 shows the abstract message flow as shown in Figure 1 of 114 [I-D.ietf-oauth-v2]. 116 +--------+ +---------------+ 117 | |--(A)- Authorization Request ->| Resource | 118 | | | Owner | 119 | |<-(B)-- Authorization Grant ---| | 120 | | +---------------+ 121 | | 122 | | +---------------+ 123 | |--(C)-- Authorization Grant -->| Authorization | 124 | Client | | Server | 125 | |<-(D)----- Access Token -------| | 126 | | +---------------+ 127 | | 128 | | +---------------+ 129 | |--(E)----- Access Token ------>| Resource | 130 | | | Server | 131 | |<-(F)--- Protected Resource ---| | 132 +--------+ +---------------+ 134 Figure 1: Abstract OAuth 2.0 Protocol Flow 136 This document takes advantage of the OAuth protocol and its 137 deployment base to provide a way to use SASL [RFC4422] as well as the 138 GSS-API [RFC2743] to gain access to resources when using non-HTTP- 139 based protocols, such as the Internet Message Access Protocol (IMAP) 140 [RFC3501], which is what this memo uses in the examples. 142 The Simple Authentication and Security Layer (SASL) is a framework 143 for providing authentication and data security services in 144 connection-oriented protocols via replaceable mechanisms. It 145 provides a structured interface between protocols and mechanisms. 146 The resulting framework allows new protocols to reuse existing 147 mechanisms and allows old protocols to make use of new mechanisms. 148 The framework also provides a protocol for securing subsequent 149 protocol exchanges within a data security layer. 151 The Generic Security Service Application Program Interface (GSS-API) 152 [RFC2743] provides a framework for applications to support multiple 153 authentication mechanisms through a unified interface. 155 This document defines a SASL mechanism for OAuth, but it conforms to 156 the new bridge between SASL and the GSS-API called GS2 [RFC5801]. 157 This means that this document defines both a SASL mechanism and a 158 GSS-API mechanism. Implementers may be interested in either the 159 SASL, the GSS-API, or even both mechanisms. To faciliate these two 160 variants, the description has been split into two parts, one part 161 that provides normative references for those interested in the SASL 162 OAuth mechanism (see Section 3), and a second part for those 163 implementers that wish to implement the GSS-API portion (see 164 Section 4). 166 When OAuth is integrated into SASL and the GSS-API the high-level 167 steps are as follows: 169 (A) The client requests authorization from the resource owner. 170 The authorization request can be made directly to the resource 171 owner (as shown), or preferably indirectly via the authorization 172 server as an intermediary. 174 (B) The client receives an authorization grant which is a 175 credential representing the resource owner's authorization, 176 expressed using one of four grant types defined in this 177 specification or using an extension grant type. The authorization 178 grant type depends on the method used by the client to request 179 authorization and the types supported by the authorization server. 181 (C) The client requests an access token by authenticating with the 182 authorization server and presenting the authorization grant. 184 (D) The authorization server authenticates the client and 185 validates the authorization grant, and if valid issues an access 186 token. 188 (E) The client requests the protected resource from the resource 189 server and authenticates by presenting the access token. 191 (F) The resource server validates the access token, and if valid, 192 serves the request. 194 Steps (E) and (F) are not defined in [I-D.ietf-oauth-v2] and are the 195 main functionality specified within this document. Additionally, an 196 optional discovery exchange is defined. Consequently, the message 197 exchange shown in Figure 2 is the result of this specification. (1) 198 and (2) denote the optional discovery exchange steps that may happen 199 before the OAuth 2.0 protocol exchange messages in steps (A)-(D) are 200 executed. Steps (E) and (F) also defined in this specification. 202 ----+ 203 +--------+ +---------------+ | 204 | |--(A)-- Authorization Request --->| Resource | | 205 | | | Owner | |Plain 206 | |<-(B)------ Access Grant ---------| | |OAuth 207 | | +---------------+ |2.0 208 | | | 209 | | Client Credentials & +---------------+ | 210 | |--(C)------ Access Grant -------->| Authorization | | 211 | Client | | Server | | 212 | |<-(D)------ Access Token ---------| | | 213 | | (w/ Optional Refresh Token) +---------------+ | 214 | | ----+ 215 | | 216 | | ----+ 217 | | (Optional discovery) +---------------+ | 218 | |--(1)------- User Name --------->| | | 219 | Client | | | | 220 | |<-(2)------ Authentication -------| | | 221 | | endpoint information | Resource | |OAuth 222 | | | Server | |over 223 | |--(E)------ Access Token -------->| | |SASL/ 224 | | | | |GSS- 225 | |<-(F)---- Protected Resource -----| | |API 226 +--------+ +---------------+ | 227 ----+ 229 Figure 2: OAuth SASL Architecture 231 Note: The discovery procedure in OAuth is still work in progress. 232 Hence, the discovery components described in this document should 233 be considered incomplete and a tentative proposal. In general, 234 there is a trade off between a generic, externally available 235 defined discovery mechanisms (such as Webfinger using host-meta 236 [I-D.hammer-hostmeta], or [I-D.jones-simple-web-discovery]) and 237 configuration information exchanged in-band between the SASL 238 communication endpoints. 240 It is worthwhile to note that this specification is also compatible 241 with OAuth 1.0a [RFC5849]. 243 2. Terminology 245 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 246 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 247 document are to be interpreted as described in [RFC2119]. 249 The reader is assumed to be familiar with the terms used in the OAuth 250 2.0 specification [I-D.ietf-oauth-v2]. 252 In examples, "C:" and "S:" indicate lines sent by the client and 253 server respectively. Line breaks have been inserted for readability. 255 Note that the IMAP SASL specification requires base64 encoding 256 message, not this memo. 258 3. OAuth SASL Mechanism Specification 260 SASL is used as a generalized authentication method in a variety of 261 application layer protocols. This document defines two SASL 262 mechanisms for usage with OAuth: "OAUTH" and "OAUTH-PLUS". The 263 "OAUTH" SASL mechanism provides bearer token alike semantic for SASL 264 while "OAUTH-PLUS" provides a semantic similar to OAuth MAC 265 authentication by utilizing a channel binding mechanism [RFC5056]. 267 3.1. Channel Binding 269 If the specification for the underlying authorization scheme requires 270 a security layer, such as TLS [RFC5246], the server SHOULD only offer 271 a mechanism where channel binding can be enabled. 273 The channel binding data is computed by the client based on it's 274 choice of preferred channel binding type. As specified in [RFC5056], 275 the channel binding information MUST start with the channel binding 276 unique prefix, followed by a colon (ASCII 0x3A), followed by a base64 277 encoded channel binding payload. The channel binding payload is the 278 raw data from the channel binding type if the raw channel binding 279 data is less than 500 bytes. If the raw channel binding data is 500 280 bytes or larger then a SHA-1 [RFC3174] hash of the raw channel 281 binding data is computed. 283 If the client is using tls-unique for a channel binding then the raw 284 channel binding data equals the first TLS finished message. This is 285 under the 500 byte limit, so the channel binding payload sent to the 286 server would be the base64 encoded first TLS finished message. 288 In the case where the client has chosen tls-endpoint, the raw channel 289 binding data is the certificate of the server the client connected 290 to, which will frequently be 500 bytes or more. If it is then the 291 channel binding payload is the base64 encoded SHA-1 hash of the 292 server certificate. 294 3.2. Initial Client Response 296 The SASL client response is formatted as an HTTP [RFC2616] request. 297 The HTTP request is limited in that the path MUST be "/". In the 298 OAUTH mechanism no query string is allowed. The following header 299 lines are defined in the client response: 301 User (OPTIONAL): Contains the user identifier being 302 authenticated, and is provided to allow correct discovery 303 information to be returned. 305 Host (REQUIRED): Contains the host name to which the client 306 connected. 308 Authorization (REQUIRED): An HTTP Authorization header. 310 The user name is provided by the client to allow the discovery 311 information to be customized for the user, a given server could allow 312 multiple authenticators and it needs to return the correct one. For 313 instance, a large ISP could provide mail service for several domains 314 who manage their own user information. For instance, users at foo- 315 example.com could be authenticated by an OAuth service at 316 https://oauth.foo-example.com/, and users at bar-example.com could be 317 authenticated by https://oauth.bar-example.com, but both could be 318 served by a hypothetical IMAP server running at a third domain, 319 imap.example.net. 321 3.2.1. Query String in OAUTH-PLUS 323 In the OAUTH-PLUS mechanism the channel binding information is 324 carried in the query string. OAUTH-PLUS defines following query 325 parameter(s): 327 cbdata (REQUIRED): Contains the base64 encoded channel binding 328 data, properly escaped as an HTML query parameter value. 330 3.3. Server's Response 332 The server validates the response per the specification for the 333 authorization scheme used. If the authorization scheme used includes 334 signing of the request parameters the client must provide a complete 335 HTTP style request that satisfies the data requirements for the 336 scheme in use. 338 In the OAUTH-PLUS mechanism the server examines the channel binding 339 data, extracts the channel binding unique prefix, and extracts the 340 raw channel biding data based on the channel binding type used. It 341 then computes it's own copy of the channel binding payload and 342 compares that to the payload sent by the client in the query 343 parameters of the tunneled HTTP request. Those two must be equal for 344 channel binding to succeed. 346 The server responds to a successfully verified client message by 347 completing the SASL negotiation. The authentication scheme MUST 348 carry the user ID to be used as the authorization identity (identity 349 to act as). The server MUST use that ID as the user being 350 authorized, that is the user assertion we accept and not other 351 information such as from the URL or "User:" header. 353 The server responds to failed authentication by sending discovery 354 information in an HTTP style response with the HTTP status code set 355 to 401, and then failing the authentication. 357 If channel binding is in use and the channel binding fails the server 358 responds with a minimal HTTP response without discovery information 359 and the HTTP status code set to 412 to indicate that the channel 360 binding precondition failed. If the authentication scheme in use 361 does not include signing the server SHOULD revoke the presented 362 credential and the client SHOULD discard that credential. 364 3.4. Mapping to SASL Identities 366 Some OAuth mechanisms can provide both an authorization identity and 367 an authentication identity. An example of this is OAuth 1.0a 368 [RFC5849] where the consumer key (oauth_consumer_key) identifies the 369 entity using to token which equates to the SASL authentication 370 identity, and is authenticated using the shared secret. The 371 authorization identity in the OAuth 1.0a case is carried in the token 372 (per the requirement above), which SHOULD validated independently. 373 The server MAY use a consumer key or other comparable identity in the 374 OAuth authorization scheme as the SASL authentication identity. If 375 an appropriate authentication identity is not available the server 376 MUST use the identity asserted in the token. 378 3.5. Discovery Information 380 The server MUST send discovery information in response to a failed 381 authentication exchange or a request with an empty Authorization 382 header. If discovery information is returned it MUST include an 383 authentication endpoint appropriate for the user. If the "User" 384 header is present the discovery information MUST be for that user. 385 Discovery information is provided by the server to the client to 386 allow a client to discover the appropriate OAuth authentication and 387 token endpoints. The client then uses that information to obtain the 388 access token needed for OAuth authentication. The client SHOULD 389 cache and re-use the user specific discovery information for service 390 endpoints. 392 Discovery information makes use of both the WWW-Authenticate header 393 as defined in HTTP Authentication: Basic and Digest Access 394 Authentication [RFC2617] and Link headers as defined in [RFC5988]. 396 The following elements are defined for discovery information: 398 WWW-Authenticate A WWW-Authenticate header for each authentication 399 scheme supported by the server. Authentication scheme names are 400 case insensitive. The following [RFC2617] authentication 401 parameters are defined: 403 realm REQUIRED -- (as defined by RFC2617) 405 scope OPTIONAL -- A quoted string. This provides the client an 406 OAuth 2 scope known to be valid for the resource. 408 oauth2-authenticator An [RFC5988] Link header specifying the 409 [I-D.ietf-oauth-v2] authentication endpoint. This link has an 410 OPTIONAL link-extension "scheme", if included this link applies 411 ONLY to the specified scheme. 413 oauth2-token An [RFC5988] Link header specifying the 414 [I-D.ietf-oauth-v2] token endpoint. This link has an OPTIONAL 415 link-extension "scheme", if included this link applies ONLY to the 416 specified scheme. 418 oauth-initiate (Optional) An [RFC5988] Link header specifying the 419 OAuth1.0a [RFC5849] initiation endpoint. The server MUST send 420 this if "OAuth" is included in the supported list of HTTP 421 authentication schemes for the server. 423 oauth-authorize (Optional) An [RFC5988] Link header specifying the 424 OAuth1.0a [RFC5849] authentication endpoint. The server MUST send 425 this if "OAuth" is included in the supported list of HTTP 426 authentication schemes for the server. 428 oauth-token (Optional) An [RFC5988] Link header specifying the 429 OAuth1.0a [RFC5849] token endpoint. The server MUST send this if 430 "OAuth" is included in the supported list of HTTP authentication 431 schemes for the server. This link type has one link-extension 432 "grant-types" which is a space separated list of the OAuth 2.0 433 grant types that can be used at the token endpoint to obtain a 434 token. 436 Usage of the URLs provided in the discovery information is defined in 437 the relevant specifications. If the server supports multiple 438 authenticators the discovery information returned for unknown users 439 MUST be consistent with the discovery information for known users to 440 prevent user enumeration. The OAuth 2.0 specification 441 [I-D.ietf-oauth-v2] supports multiple types of authentication schemes 442 and the server MUST specify at least one supported authentication 443 scheme in the discovery information. The server MAY support multiple 444 schemes and MAY support schemes not listed in the discovery 445 information. 447 If the resource server provides a scope the client SHOULD always 448 request scoped tokens from the token endpoint. The client MAY use a 449 scope other than the one provided by the resource server. Scopes 450 other than those advertised by the resource server must be defined by 451 the resource owner and provided in service documentation (which is 452 beyond the scope of this memo). 454 3.6. Use of Signature Type Authorization 456 This mechanism supports authorization using signatures, which 457 requires that both client and server construct the string to be 458 signed. OAuth 2 is designed for authentication/authorization to 459 access specific URIs. SASL is designed for user authentication, and 460 has no facility for being more specific. In this mechanism we 461 require an HTTP style format specifically to support signature type 462 authentication, but this is extremely limited. The HTTP style 463 request is limited to a path of "/". This mechanism is in the SASL 464 model, but is designed so that no changes are needed if there is a 465 revision of SASL which supports more specific resource authorization, 466 e.g. IMAP access to a specific folder or FTP access limited to a 467 specific directory. 469 Using the example in the MAC specification 470 [I-D.ietf-oauth-v2-http-mac] as a starting point, on an IMAP server 471 running on port 143 and given the MAC style authorization request 472 (with long lines wrapped for readability) below: 474 GET / HTTP/1.1 475 Host: server.example.com 476 User: user@example.com 477 Authorization: MAC token="h480djs93hd8",timestamp="137131200", 478 nonce="dj83hs9s",signature="YTVjyNSujYs1WsDurFnvFi4JK6o=" 480 The normalized request string would be constructed per the MAC 481 specification [I-D.ietf-oauth-v2-http-mac]. In this example the 482 normalized request string with the new line separator character is 483 represented by "\n" for display purposes only would be: 485 h480djs93hi8\n 486 137131200\n 487 dj83hs9s\n 488 \n 489 GET\n 490 server.example.com\n 491 143\n 492 /\n 493 \n 495 4. GSS-API OAuth Mechanism Specification 497 Note: The normative references in this section are informational for 498 SASL implementers, but they are normative for GSS-API implementers. 500 The SASL OAuth mechanism is also a GSS-API mechanism and the messages 501 described in Section 3 are the same, but 503 1. the GS2 header on the client's first message is excluded when 504 OAUTH is used as a GSS-API mechanism, and 506 2. initial context token header is prefixed to the client's first 507 authentication message (context token), as described in Section 508 3.1 of RFC 2743, 510 The GSS-API mechanism OID for OAuth is [[TBD: IANA]]. 512 OAuth security contexts always have the mutual_state flag 513 (GSS_C_MUTUAL_FLAG) set to TRUE. OAuth supports credential 514 delegation, therefore security contexts may have the deleg_state flag 515 (GSS_C_DELEG_FLAG) set to either TRUE or FALSE. 517 The mutual authentication property of this mechanism relies on 518 successfully comparing the TLS server identity with the negotiated 519 target name. Since the TLS channel is managed by the application 520 outside of the GSS-API mechanism, the mechanism itself is unable to 521 confirm the name while the application is able to perform this 522 comparison for the mechanism. For this reason, applications MUST 523 match the TLS server identity with the target name, as discussed in 524 [RFC6125]. 526 The OAuth mechanism does not support per-message tokens or 527 GSS_Pseudo_random. 529 OAuth supports a standard generic name syntax for acceptors, such as 530 GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], Section 4.1). These 531 service names MUST be associated with the "entityID" claimed by the 532 RP. OAuth supports only a single name type for initiators: 533 GSS_C_NT_USER_NAME. GSS_C_NT_USER_NAME is the default name type. 534 The query, display, and exported name syntaxes for OAuth principal 535 names are all the same. There is no OAuth-specific name syntax; 536 applications SHOULD use generic GSS-API name types, such as 537 GSS_C_NT_USER_NAME and GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], 538 Section 4). The exported name token does, of course, conform to 539 [RFC2743], Section 3.2, but the "NAME" part of the token should be 540 treated as a potential input string to the OAuth name normalization 541 rules. 543 5. Examples 545 These example illustrate exchanges between an IMAP client and an IMAP 546 server. 548 5.1. Successful Bearer Token Exchange 550 This example shows a successful OAuth 2.0 bearer token exchange with 551 an initial client response. Note that line breaks are inserted for 552 readability. 554 S: * IMAP4rev1 Server Ready 555 C: t0 CAPABILITY 556 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH 557 S: t0 OK Completed 558 C: t1 AUTHENTICATE OAUTH R0VUIC8gSFRUUC8xLjENCkhvc3Q6IGltYXAuZXhhbXBs 559 ZS5jb20NCkF1dGhvcml6YXRpb246IEJFQVJFUiAidkY5ZGZ0NHFtVGMyTnZiM1J 560 sY2tCaGJIUmhkbWx6ZEdFdVkyOXRDZz09Ig0KDQo= 561 S: + 562 S: t1 OK SASL authentication succeeded 564 As required by IMAP [RFC3501], the payloads are base64-encoded. The 565 decoded initial client response is: 567 GET / HTTP/1.1 568 Host: imap.example.com 569 Authorization: BEARER "vF9dft4qmTc2Nvb3RlckBhbHRhdmlzdGEuY29tCg==" 571 The line containing just a "+" and a space is an empty response from 572 the server. This response contains discovery information, and in the 573 success case no discovery information is necessary so the response is 574 empty. Like other messages, and in accordance with the IMAP SASL 575 binding, the empty response is base64-encoded. 577 5.2. MAC Authentication with Channel Binding 579 This example shows a channel binding failure. The example sends the 580 same request as above, but in the context of an OAUTH-PLUS exchange 581 the channel binding information is missing. Note that line breaks 582 are inserted for readability. 584 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 585 S: t0 OK Completed 586 C: t1 AUTHENTICATE MAC R0VUIC8/Y2JkYXRhPSJTRzkzSUdKcFp5QnBjeUJoSUZSTVV5Q 587 m1hVzVoYkNCdFpYTnpZV2RsUHdvPSIgSFRUUC8xLjENCkhvc3Q6IHNlcnZlci5leGFtcG 588 xlLmNvbQ0KVXNlcjogdXNlckBleGFtcGxlLmNvbQ0KQXV0aG9yaXphdGlvbjogTUFDIHR 589 va2VuPSJoNDgwZGpzOTNoZDgiLHRpbWVzdGFtcD0iMTM3MTMxMjAwIixub25jZT0iZGo4 590 M2hzOXMiLHNpZ25hdHVyZT0iV1c5MUlHMTFjM1FnWW1VZ1ltOXlaV1F1SUFvPSINCg0K 591 S: + 592 S: t1 OK SASL authentication succeeded 594 As required by IMAP [RFC3501], the payloads are base64-encoded. The 595 decoded initial client response is: 597 GET /?cbdata="SG93IGJpZyBpcyBhIFRMUyBmaW5hbCBtZXNzYWdlPwo=" HTTP/1.1 598 Host: server.example.com 599 User: user@example.com 600 Authorization: MAC token="h480djs93hd8",timestamp="137131200", 601 nonce="dj83hs9s",signature="WW91IG11c3QgYmUgYm9yZWQuIAo=" 603 The line containing just a "+" and a space is an empty response from 604 the server. This response contains discovery information, and in the 605 success case no discovery information is necessary so the response is 606 empty. Like other messages, and in accordance with the IMAP SASL 607 binding, the empty response is base64-encoded. 609 5.3. Failed Exchange 611 This example shows a failed exchange because of the empty 612 Authorization header, which is how a client can query for discovery 613 information. Note that line breaks are inserted for readability. 615 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 616 S: t0 OK Completed 617 C: t1 AUTHENTICATE OAUTH R0VUIC8gSFRUUC8xLjENClVzZXI6IHNjb290ZXJAYW 618 x0YXZpc3RhLmNvbQ0KSG9zdDogaW1hcC55YWhvby5jb20NCkF1dGhlbnRpY2F0ZT 619 ogDQoNCg== 620 S: + SFRUUC8xLjEgNDAxIFVuYXV0aG9yaXplZA0KV1dXLUF1dGhlbnRpY2F0ZTogQk 621 VBUkVSIHJlYWxtPSJleGFtcGxlLmNvbSINCkxpbms6IDxodHRwczovL2xvZ2luLn 622 lhaG9vLmNvbS9vYXV0aD4gcmVsPSJvYXV0aDItYXV0aGVudGljYXRvciIgIA0KTG 623 luazogPGh0dHBzOi8vbG9naW4ueWFob28uY29tL29hdXRoPiByZWw9Im91YXRoMi 624 10b2tlbiINCg0K 625 S: t1 NO SASL authentication failed 627 The decoded initial client response is: 629 GET / HTTP/1.1 630 User: alice@example.com 631 Host: imap.example.com 632 Authorization: 634 The decoded server discovery response is: 636 HTTP/1.1 401 Unauthorized 637 WWW-Authenticate: BEARER realm="example.com" 638 Link: rel="oauth2-authenticator" 639 Link: rel="oauth2-token" 641 5.4. Failed Channel Binding 643 This example shows a channel binding failure in a discovery request. 644 The channel binding information is empty. Note that line breaks are 645 inserted for readability. 647 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 648 S: t0 OK Completed 649 C: t1 AUTHENTICATE OAUTH R0VUIC8/Y2JkYXRhPSIiIEhUVFAvMS4xDQpVc2VyOi 650 BhbGljZUBleGFtcGxlLmNvbQ0KSG9zdDogaW1hcC5leGFtcGxlLmNvbQ0KQXV0aG 651 9yaXphdGlvbjoNCg0K 652 S: + SFRUUC8xLjEgNDEyIFByZWNvbmRpdGlvbiBGYWlsZWQNCg0KDQo= 653 S: t1 NO SASL authentication failed 655 The decoded initial client response is: 657 GET /?cbdata="" HTTP/1.1 658 User: alice@example.com 659 Host: imap.example.com 660 Authorization: 662 The decoded server response is: 664 HTTP/1.1 412 Precondition Failed 666 6. Security Considerations 668 This mechanism does not provide a security layer, but does provide a 669 provision for channel binding. The OAuth 2 specification 670 [I-D.ietf-oauth-v2] allows for a variety of usages, and the security 671 properties of these profiles vary. The usage of bearer tokens, for 672 example, provide security features similar to cookies. Applications 673 using this mechanism SHOULD exercise the same level of care using 674 this mechanism as they would in using the SASL PLAIN mechanism. In 675 particular, TLS 1.2 or an equivalent secure channel MUST be 676 implemented and its usage is RECOMMENDED. 678 Channel binding in this mechanism has different properties based on 679 the authentication scheme used. Channel binding to TLS with a bearer 680 token provides only a binding to the TLS layer. Authentication 681 schemes like MAC tokens have a signature over the channel binding 682 information. These provide additional protection against a man in 683 the middle attacks, and the MAC authorization header is bound to the 684 channel and only valid in that context. 686 It is possible that SASL will be authenticating a connection and the 687 life of that connection may outlast the life of the token used to 688 authenticate it. This is a common problem in application protocols 689 where connections are long-lived, and not a problem with this 690 mechanism per se. Servers MAY unilaterally disconnect clients in 691 accordance with the application protocol. 693 An OAuth credential is not equivalent to the password or primary 694 account credential. There are protocols like XMPP that allow actions 695 like change password. The server SHOULD ensure that actions taken in 696 the authenticated channel are appropriate to the strength of the 697 presented credential. 699 It is possible for an application server running on Evil.example.com 700 to tell a client to request a token from Good.example.org. A client 701 following these instructions will pass a token from Good to Evil. 702 This is by design, since it is possible that Good and Evil are merely 703 names, not descriptive, and that this is an innocuous activity 704 between cooperating two servers in different domains. For instance, 705 a site might operate their authentication service in-house, but 706 outsource their mail systems to an external entity. 708 Tokens have a lifetime associated with them. Reducing both the 709 lifetime of a token provides security benefits in case that tokens 710 leak. In addition a previously obtained token MAY be revoked or 711 rendered invalid at any time. The client MAY request a new access 712 token for each connection to a resource server, but it SHOULD cache 713 and re-use access credentials that appear to be valid. 715 7. IANA Considerations 717 7.1. SASL Registration 719 The IANA is requested to register the following SASL profile: 721 SASL mechanism profile: OAUTH 723 Security Considerations: See this document 725 Published Specification: See this document 727 For further information: Contact the authors of this document. 729 Owner/Change controller: the IETF 731 Note: None 733 The IANA is requested to register the following SASL profile: 735 SASL mechanism profile: OAUTH-PLUS 737 Security Considerations: See this document 739 Published Specification: See this document 741 For further information: Contact the authors of this document. 743 Owner/Change controller: the IETF 745 Note: None 747 7.2. GSS-API Registration 749 IANA is further requested to assign an OID for this GSS mechanism in 750 the SMI numbers registry, with the prefix of 751 iso.org.dod.internet.security.mechanisms (1.3.6.1.5.5) and to 752 reference this specification in the registry. 754 7.3. Link Type Registration 756 Pursuant to [RFC5988] The following link type registrations [[will 757 be]] registered by mail to link-relations@ietf.org. 759 7.3.1. OAuth 2 Authentication Endpoint 760 o Relation Name: oauth2-authenticator 762 o Description: An OAuth 2.0 authentication endpoint. 764 o Reference: 766 o Notes: This link type indicates an OAuth 2.0 authentication 767 endpoint that can be used for user authentication/authorization 768 for the endpoint providing the link. 770 o Application Data: [optional] 772 7.3.2. OAuth 2 Token Endpoint 774 o Relation Name: oauth2-token 776 o Description: The OAuth token endpoint used to get tokens for 777 access. 779 o Reference: 781 o Notes: The OAuth 2.0 token endpoint to be used for obtaining 782 tokens to access the endpoint providing the link. 784 o Application Data: This link type has one link-extension "grant- 785 types", which is the OAuth 2.0 grant types that can be used at the 786 token endpoint to obtain a token. This is not an exclusive list, 787 it provides a hint to the application of what SHOULD be valid. A 788 token endpoint MAY support additional grant types not advertised 789 by a resource endpoint. 791 7.3.3. OAuth 1.0a Request Initiation Endpoint 793 o Relation Name: oauth-initiate 795 o Description: The OAuth 1.0a request initiation endpoint used to 796 get tokens for access. 798 o Reference: 800 o Notes: The OAuth 1.0a endpoint used to initiate the sequence, this 801 temporary request is what the user approves to grant access to the 802 resource. 804 o Application Data: 806 7.3.4. OAuth 1.0a Authorization Endpoint 808 o Relation Name: oauth-authorize 810 o Description: The OAuth 1.0a authorization endpoint used to approve 811 an access request. 813 o Reference: 815 o Notes: 817 o Application Data: 819 7.3.5. OAuth 1.0a Token Endpoint 821 o Relation Name: oauth-token 823 o Description: The OAuth 1.0a token endpoint used to get tokens for 824 access. 826 o Reference: 828 o Notes: 830 o Application Data: 832 8. Appendix A -- Document History 834 [[ to be removed by RFC editor before publication as an RFC ]] 836 -04 838 o Editorial clean-up and text in introduction improved. 840 o Added GSS-API support 842 -03 844 o Fixing channel binding, not tls-unique specific. Also defining 845 how the CB data is properly generated. 847 o Various small editorial changes and embarassing spelling fixes. 849 -02 851 o Filling out Channel Binding 853 o Added text clarifying how to bind to the 2 kinds of SASL 854 identities. 856 -01 858 o Bringing this into line with draft 12 of the core spec, the bearer 859 token spec, and references the MAC token spec 861 o Changing discovery over to using the Link header construct from 862 RFC5988. 864 o Added the seeds of channel binding. 866 -00 868 o Initial revision 870 9. References 872 9.1. Normative References 874 [I-D.ietf-oauth-v2] 875 Hammer-Lahav, E., Recordon, D., and D. Hardt, "The OAuth 876 2.0 Authorization Protocol", draft-ietf-oauth-v2-22 (work 877 in progress), September 2011. 879 [I-D.ietf-oauth-v2-bearer] 880 Jones, M., Hardt, D., and D. Recordon, "The OAuth 2.0 881 Authorization Protocol: Bearer Tokens", 882 draft-ietf-oauth-v2-bearer-14 (work in progress), 883 November 2011. 885 [I-D.ietf-oauth-v2-http-mac] 886 Hammer-Lahav, E., Barth, A., and B. Adida, "HTTP 887 Authentication: MAC Access Authentication", 888 draft-ietf-oauth-v2-http-mac-00 (work in progress), 889 May 2011. 891 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 892 Requirement Levels", BCP 14, RFC 2119, March 1997. 894 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 895 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 896 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 898 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 899 Leach, P., Luotonen, A., and L. Stewart, "HTTP 900 Authentication: Basic and Digest Access Authentication", 901 RFC 2617, June 1999. 903 [RFC2743] Linn, J., "Generic Security Service Application Program 904 Interface Version 2, Update 1", RFC 2743, January 2000. 906 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 907 (SHA1)", RFC 3174, September 2001. 909 [RFC4422] Melnikov, A. and K. Zeilenga, "Simple Authentication and 910 Security Layer (SASL)", RFC 4422, June 2006. 912 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 913 Channels", RFC 5056, November 2007. 915 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 916 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 918 [RFC5801] Josefsson, S. and N. Williams, "Using Generic Security 919 Service Application Program Interface (GSS-API) Mechanisms 920 in Simple Authentication and Security Layer (SASL): The 921 GS2 Mechanism Family", RFC 5801, July 2010. 923 [RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, 924 April 2010. 926 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 927 for TLS", RFC 5929, July 2010. 929 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010. 931 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 932 Verification of Domain-Based Application Service Identity 933 within Internet Public Key Infrastructure Using X.509 934 (PKIX) Certificates in the Context of Transport Layer 935 Security (TLS)", RFC 6125, March 2011. 937 9.2. Informative References 939 [I-D.hammer-hostmeta] 940 Hammer-Lahav, E. and B. Cook, "Web Host Metadata", 941 draft-hammer-hostmeta-17 (work in progress), 942 September 2011. 944 [I-D.jones-simple-web-discovery] 945 Jones, M. and Y. Goland, "Simple Web Discovery (SWD)", 946 draft-jones-simple-web-discovery-01 (work in progress), 947 July 2011. 949 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 950 4rev1", RFC 3501, March 2003. 952 Authors' Addresses 954 William Mills 955 Yahoo! Inc. 957 Phone: 958 Email: wmills@yahoo-inc.com 960 Tim Showalter 961 Yahoo! Inc. 963 Phone: 964 Email: timshow@yahoo-inc.com 966 Hannes Tschofenig 967 Nokia Siemens Networks 968 Linnoitustie 6 969 Espoo 02600 970 Finland 972 Phone: +358 (50) 4871445 973 Email: Hannes.Tschofenig@gmx.net 974 URI: http://www.tschofenig.priv.at