idnits 2.17.1 draft-ietf-kitten-sasl-oauth-03.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 (August 6, 2012) is 4280 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: 'RFC2616' is defined on line 711, but no explicit reference was found in the text == Unused Reference: 'RFC2617' is defined on line 715, but no explicit reference was found in the text == Unused Reference: 'RFC5929' is defined on line 749, but no explicit reference was found in the text == Unused Reference: 'RFC5988' is defined on line 752, but no explicit reference was found in the text == Outdated reference: A later version (-05) exists of draft-ietf-oauth-v2-http-mac-01 ** 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 4627 (Obsoleted by RFC 7158, RFC 7159) ** 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) -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) Summary: 8 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 Yahoo! Inc. 4 Intended status: Standards Track T. Showalter 5 Expires: February 7, 2013 6 H. Tschofenig 7 Nokia Siemens Networks 8 August 6, 2012 10 A SASL and GSS-API Mechanism for OAuth 11 draft-ietf-kitten-sasl-oauth-03 13 Abstract 15 OAuth enables a third-party application to obtain limited access to a 16 protected resource, either on behalf of a resource owner by 17 orchestrating an approval interaction, or by allowing the third-party 18 application to obtain access on its own behalf. 20 This document defines how an application client uses OAuth over the 21 Simple Authentication and Security Layer (SASL) or the Generic 22 Security Service Application Program Interface (GSS-API) to access a 23 protected resource at a resource serve. Thereby, it enables schemes 24 defined within the OAuth framework for non-HTTP-based application 25 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 February 7, 2013. 51 Copyright Notice 53 Copyright (c) 2012 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. Initial Client Response . . . . . . . . . . . . . . . . . 8 72 3.1.1. Reserved Key/Values in OAUTH . . . . . . . . . . . . . 9 73 3.2. Server's Response . . . . . . . . . . . . . . . . . . . . 9 74 3.2.1. Mapping to SASL Identities . . . . . . . . . . . . . . 9 75 3.2.2. Server response to failed authentication. . . . . . . 10 76 3.3. Use of Signature Type Authorization . . . . . . . . . . . 10 77 3.4. Channel Binding . . . . . . . . . . . . . . . . . . . . . 11 78 4. GSS-API OAuth Mechanism Specification . . . . . . . . . . . . 13 79 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 80 5.1. Successful Bearer Token Exchange . . . . . . . . . . . . . 14 81 5.2. MAC Authentication with Channel Binding . . . . . . . . . 14 82 5.3. Failed Exchange . . . . . . . . . . . . . . . . . . . . . 15 83 5.4. Failed Channel Binding . . . . . . . . . . . . . . . . . . 16 84 6. Security Considerations . . . . . . . . . . . . . . . . . . . 17 85 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 86 7.1. SASL Registration . . . . . . . . . . . . . . . . . . . . 18 87 7.2. GSS-API Registration . . . . . . . . . . . . . . . . . . . 18 88 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 19 89 8.1. Normative References . . . . . . . . . . . . . . . . . . . 19 90 8.2. Informative References . . . . . . . . . . . . . . . . . . 20 91 Appendix A. Document History . . . . . . . . . . . . . . . . . . 21 92 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22 94 1. Introduction 96 OAuth [I-D.ietf-oauth-v2] enables a third-party application to obtain 97 limited access to a protected resource, either on behalf of a 98 resource owner by orchestrating an approval interaction, or by 99 allowing the third-party application to obtain access on its own 100 behalf. The core OAuth specification [I-D.ietf-oauth-v2] does not 101 define the interaction between the client and the resource server 102 with the access to a protected resource using an Access Token. This 103 functionality is described in two separate specifications, namely 104 [I-D.ietf-oauth-v2-bearer], and [I-D.ietf-oauth-v2-http-mac], whereby 105 the focus is on an HTTP-based environment only. 107 Figure 1 shows the abstract message flow as shown in Figure 1 of 108 [I-D.ietf-oauth-v2]. 110 +--------+ +---------------+ 111 | |--(A)- Authorization Request ->| Resource | 112 | | | Owner | 113 | |<-(B)-- Authorization Grant ---| | 114 | | +---------------+ 115 | | 116 | | +---------------+ 117 | |--(C)-- Authorization Grant -->| Authorization | 118 | Client | | Server | 119 | |<-(D)----- Access Token -------| | 120 | | +---------------+ 121 | | 122 | | +---------------+ 123 | |--(E)----- Access Token ------>| Resource | 124 | | | Server | 125 | |<-(F)--- Protected Resource ---| | 126 +--------+ +---------------+ 128 Figure 1: Abstract OAuth 2.0 Protocol Flow 130 This document takes advantage of the OAuth protocol and its 131 deployment base to provide a way to use SASL [RFC4422] as well as the 132 GSS-API [RFC2743] to gain access to resources when using non-HTTP- 133 based protocols, such as the Internet Message Access Protocol (IMAP) 134 [RFC3501], which is what this memo uses in the examples. 136 The Simple Authentication and Security Layer (SASL) is a framework 137 for providing authentication and data security services in 138 connection-oriented protocols via replaceable mechanisms. It 139 provides a structured interface between protocols and mechanisms. 140 The resulting framework allows new protocols to reuse existing 141 mechanisms and allows old protocols to make use of new mechanisms. 142 The framework also provides a protocol for securing subsequent 143 protocol exchanges within a data security layer. 145 The Generic Security Service Application Program Interface (GSS-API) 146 [RFC2743] provides a framework for applications to support multiple 147 authentication mechanisms through a unified interface. 149 This document defines a SASL mechanism for OAuth, but it conforms to 150 the new bridge between SASL and the GSS-API called GS2 [RFC5801]. 151 This means that this document defines both a SASL mechanism and a 152 GSS-API mechanism. Implementers may be interested in either the 153 SASL, the GSS-API, or even both mechanisms. To faciliate these two 154 variants, the description has been split into two parts, one part 155 that provides normative references for those interested in the SASL 156 OAuth mechanism (see Section 3), and a second part for those 157 implementers that wish to implement the GSS-API portion (see 158 Section 4). 160 When OAuth is integrated into SASL and the GSS-API the high-level 161 steps are as follows: 163 (A) The client requests authorization from the resource owner. 164 The authorization request can be made directly to the resource 165 owner (as shown), or preferably indirectly via the authorization 166 server as an intermediary. 168 (B) The client receives an authorization grant which is a 169 credential representing the resource owner's authorization, 170 expressed using one of four grant types defined in this 171 specification or using an extension grant type. The authorization 172 grant type depends on the method used by the client to request 173 authorization and the types supported by the authorization server. 175 (C) The client requests an access token by authenticating with the 176 authorization server and presenting the authorization grant. 178 (D) The authorization server authenticates the client and 179 validates the authorization grant, and if valid issues an access 180 token. 182 (E) The client requests the protected resource from the resource 183 server and authenticates by presenting the access token. 185 (F) The resource server validates the access token, and if valid, 186 serves the request. 188 Steps (E) and (F) are not defined in [I-D.ietf-oauth-v2] and are the 189 main functionality specified within this document. Consequently, the 190 message exchange shown in Figure 2 is the result of this 191 specification. The client will genrally need to determine the 192 authentication endpoints (and perhaps the service endpoints) before 193 the OAuth 2.0 protocol exchange messages in steps (A)-(D) are 194 executed. The discovery of the resource owner and authorization 195 server endpoints is outside the scope of this specification. The 196 client must discover those endpoints using a discovery mechanisms 197 such as Webfinger using host-meta [I-D.jones-appsawg-webfinger]. In 198 band discovery is not tenable if clients support the OAuth 2.0 199 password grant. Once credentials are obtained the client proceeds to 200 steps (E) and (F) 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 | | | | |OAuth 218 | |--(E)------ Access Token -------->| Resource | |over 219 | | | Server | |SASL/ 220 | |<-(F)---- Protected Resource -----| | |GSS- 221 | | | | |API 222 +--------+ +---------------+ | 223 ----+ 225 Figure 2: OAuth SASL Architecture 227 It is worthwhile to note that this specification is also compatible 228 with OAuth 1.0a [RFC5849]. 230 2. Terminology 232 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 233 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 234 document are to be interpreted as described in [RFC2119]. 236 The reader is assumed to be familiar with the terms used in the OAuth 237 2.0 specification [I-D.ietf-oauth-v2]. 239 In examples, "C:" and "S:" indicate lines sent by the client and 240 server respectively. Line breaks have been inserted for readability. 242 Note that the IMAP SASL specification requires base64 encoding 243 message, not this memo. 245 3. OAuth SASL Mechanism Specification 247 SASL is used as a generalized authentication method in a variety of 248 application layer protocols. This document defines two SASL 249 mechanisms for usage with OAuth: "OAUTH" and "OAUTH-PLUS". The 250 "OAUTH" SASL mechanism enables OAuth authorizattion schemes for SASL, 251 "OAUTH-PLUS" adds channel binding [RFC5056] capability for additional 252 security guarantees. 254 3.1. Initial Client Response 256 Client responses are a key/value pair sequence. These key/value 257 pairs carry the equivalent values from an HTTP context in order to be 258 able to complete an OAuth style HTTP authorization. The ABNF 259 [RFC5234] syntax is 261 kvsep = %x01 262 key = 1*ALPHA 263 value = *(VCHAR | SP | HTAB | CR | LF ) 264 kvpair = key "=" value kvsep 265 client_resp = 1*kvpair kvsep 267 The following key/value pairs are defined in the client response: 269 auth (REQUIRED): The payload of the HTTP Authorization header for 270 an equivalent HTTP OAuth authroization. 272 user (REQUIRED): Contains the user name being authenticated. The 273 server MAY use this as a routing or database lookup hint. The 274 server MUST NOT use this as authoritative, the user name MUST 275 be asserted by the OAuth credential. 277 host: Contains the host name to which the client connected. 279 port: Contains the port number represented as a decimal positive 280 integer string without leading zeros to which the client 281 connected. 283 In authorization schemes that use signatures, the client MUST send 284 host and port number key/values, and the server MUST fail an 285 authorization request requiring signatures that does not have host 286 and port values. 288 3.1.1. Reserved Key/Values in OAUTH 290 In the OAUTH mechanism values for path, query string and post body 291 are assigned default values. OAuth authorization schemes MAY define 292 usage of these in the SASL context and extend this specification. 293 For OAuth schemes that use request signatures the default values MUST 294 be used unless explict values are provided in the client response. 295 The following key values are reserved for future use: 297 path (RESERVED): HTTP path data, the default value is "/". 299 qs (RESERVED): HTTP query string, the default value is "". 301 post (RESERVED): HTTP post data, the default value is "". 303 3.2. Server's Response 305 The server validates the response per the specification for the 306 authorization scheme used. If the authorization scheme used includes 307 signing of the request parameters the client must provide a client 308 response that satisfies the data requirements for the scheme in use. 310 In the OAUTH-PLUS mechanism the server examines the channel binding 311 data, extracts the channel binding unique prefix, and extracts the 312 raw channel biding data based on the channel binding type used. It 313 then computes it's own copy of the channel binding payload and 314 compares that to the payload sent by the client in the cbdata key/ 315 value. Those two must be equal for channel binding to succeed. 317 The server responds to a successfully verified client message by 318 completing the SASL negotiation. The authentication scheme MUST 319 carry the user ID to be used as the authorization identity (identity 320 to act as). The server MUST use the ID obtained from the credential 321 as the user being authorized. 323 3.2.1. Mapping to SASL Identities 325 Some OAuth mechanisms can provide both an authorization identity and 326 an authentication identity. An example of this is OAuth 1.0a 327 [RFC5849] where the consumer key (oauth_consumer_key) identifies the 328 entity using the token which equates to the SASL authentication 329 identity, and is authenticated using the shared secret. The 330 authorization identity in the OAuth 1.0a case is carried in the token 331 (per the requirement above), which SHOULD be validated independently. 332 The server MAY use a consumer key, a value derived from it, or other 333 comparable identity in the OAuth authorization scheme as the SASL 334 authentication identity. If an appropriate authentication identity 335 is not available the server MUST use the authorization identity as 336 the authentication identity. 338 3.2.2. Server response to failed authentication. 340 For a failed authentication the server returns a JSON [RFC4627] 341 formatted error result, and fails the authentication. The error 342 result consists of the following values: 344 status (REQUIRED): The authorization error code. Valid error 345 codes are defined in the IANA [[need registry name]] registry 346 specified in the OAuth 2 core specification. 348 schemes (REQUIRED): A space separated list of the OAuth 349 authorization schemes supported by the server, i.e. "bearer" or 350 "bearer mac". 352 scope (OPTIONAL): The OAuth scope required to access the service. 354 If the resource server provides a scope the client SHOULD always 355 request scoped tokens from the token endpoint. The client MAY use a 356 scope other than the one provided by the resource server. Scopes 357 other than those advertised by the resource server are be defined by 358 the resource owner and provided in service documentation or discovery 359 information (which is beyond the scope of this memo). If not present 360 then the client SHOULD presume an empty scope (unscoped token) is 361 needed. 363 If channel binding is in use and the channel binding fails the server 364 responds with a status code set to 412 to indicate that the channel 365 binding precondition failed. If the authentication scheme in use 366 does not include signing the server SHOULD revoke the presented 367 credential and the client SHOULD discard that credential. 369 3.3. Use of Signature Type Authorization 371 This mechanism supports authorization using signatures, which 372 requires that both client and server construct the string to be 373 signed. OAuth 2 is designed for authentication/authorization to 374 access specific URIs. SASL is designed for user authentication, and 375 has no facility for being more specific. In this mechanism we 376 require or define default values for the data elements from an HTTP 377 request which allow the signature base string to be constructed 378 properly. The default HTTP path is "/" and the default post body is 379 empty. These atoms are defined as extension points so that no 380 changes are needed if there is a revision of SASL which supports more 381 specific resource authorization, e.g. IMAP access to a specific 382 folder or FTP access limited to a specific directory. 384 Using the example in the MAC specification 385 [I-D.ietf-oauth-v2-http-mac] as a starting point, on an IMAP server 386 running on port 143 and given the MAC style authorization request 387 (with %x01 shown as ^A and line breaks added for readability) below: 389 host=server.example.com^A 390 user=user@example.com^A 391 port=143^A 392 auth=MAC token="h480djs93hd8",timestamp="137131200",nonce="dj83hs9s", 393 signature="YTVjyNSujYs1WsDurFnvFi4JK6o="^A^A 395 The normalized request string would be constructed per the MAC 396 specification [I-D.ietf-oauth-v2-http-mac]. In this example the 397 normalized request string with the new line separator character is 398 represented by "\n" for display purposes only would be: 400 h480djs93hi8\n 401 137131200\n 402 dj83hs9s\n 403 \n 404 GET\n 405 server.example.com\n 406 143\n 407 /\n 408 \n 410 3.4. Channel Binding 412 If the specification for the underlying authorization scheme requires 413 a security layer, such as TLS [RFC5246], the server SHOULD only offer 414 a mechanism where channel binding can be enabled. 416 The channel binding data is computed by the client based on it's 417 choice of preferred channel binding type. As specified in [RFC5056], 418 the channel binding information MUST start with the channel binding 419 unique prefix, followed by a colon (ASCII 0x3A), followed by a base64 420 encoded channel binding payload. The channel binding payload is the 421 raw data from the channel binding type if the raw channel binding 422 data is less than 500 bytes. If the raw channel binding data is 500 423 bytes or larger then a SHA-1 [RFC3174] hash of the raw channel 424 binding data is computed. 426 If the client is using tls-unique for a channel binding then the raw 427 channel binding data equals the first TLS finished message. This is 428 under the 500 byte limit, so the channel binding payload sent to the 429 server would be the base64 encoded first TLS finished message. 431 In the case where the client has chosen tls-endpoint, the raw channel 432 binding data is the certificate of the server the client connected 433 to, which will frequently be 500 bytes or more. If it is then the 434 channel binding payload is the base64 encoded SHA-1 hash of the 435 server certificate. 437 4. GSS-API OAuth Mechanism Specification 439 Note: The normative references in this section are informational for 440 SASL implementers, but they are normative for GSS-API implementers. 442 The SASL OAuth mechanism is also a GSS-API mechanism and the messages 443 described in Section 3 are the same, but 445 1. the GS2 header on the client's first message is excluded when 446 OAUTH is used as a GSS-API mechanism, and 448 2. initial context token header is prefixed to the client's first 449 authentication message (context token), as described in Section 450 3.1 of RFC 2743, 452 The GSS-API mechanism OID for OAuth is [[TBD: IANA]]. 454 OAuth security contexts always have the mutual_state flag 455 (GSS_C_MUTUAL_FLAG) set to TRUE. OAuth supports credential 456 delegation, therefore security contexts may have the deleg_state flag 457 (GSS_C_DELEG_FLAG) set to either TRUE or FALSE. 459 The mutual authentication property of this mechanism relies on 460 successfully comparing the TLS server identity with the negotiated 461 target name. Since the TLS channel is managed by the application 462 outside of the GSS-API mechanism, the mechanism itself is unable to 463 confirm the name while the application is able to perform this 464 comparison for the mechanism. For this reason, applications MUST 465 match the TLS server identity with the target name, as discussed in 466 [RFC6125]. 468 The OAuth mechanism does not support per-message tokens or 469 GSS_Pseudo_random. 471 OAuth supports a standard generic name syntax for acceptors, such as 472 GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], Section 4.1). These 473 service names MUST be associated with the "entityID" claimed by the 474 RP. OAuth supports only a single name type for initiators: 475 GSS_C_NT_USER_NAME. GSS_C_NT_USER_NAME is the default name type. 476 The query, display, and exported name syntaxes for OAuth principal 477 names are all the same. There is no OAuth-specific name syntax; 478 applications SHOULD use generic GSS-API name types, such as 479 GSS_C_NT_USER_NAME and GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], 480 Section 4). The exported name token does, of course, conform to 481 [RFC2743], Section 3.2, but the "NAME" part of the token should be 482 treated as a potential input string to the OAuth name normalization 483 rules. 485 5. Examples 487 These example illustrate exchanges between an IMAP client and an IMAP 488 server. 490 Note to implementers: Authorization scheme names are case 491 insensitive. One example uses "Bearer" but that could as easily be 492 "bearer", "BEARER", or "BeArEr". 494 5.1. Successful Bearer Token Exchange 496 This example shows a successful OAuth 2.0 bearer token exchange with 497 an initial client response. Note that line breaks are inserted for 498 readability. 500 S: * IMAP4rev1 Server Ready 501 C: t0 CAPABILITY 502 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH 503 S: t0 OK Completed 504 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xNDMB 505 dXNlcj11c2VyQGV4YW1wbGUuY29tAWF1dGg9QmVhcmVyIHZGOWRmdDRxbVRjMk5 506 2YjNSbGNrQmhiSFJoZG1semRHRXVZMjl0Q2c9PQEB 507 S: + 508 S: t1 OK SASL authentication succeeded 510 As required by IMAP [RFC3501], the payloads are base64-encoded. The 511 decoded initial client response (with %x01 represented as ^A and long 512 lines wrapped for readability) is: 514 host=server.example.com^Aport=143^Auser=user@example.com^A 515 auth=Bearer vF9dft4qmTc2Nvb3RlckBhbHRhdmlzdGEuY29tCg==^A^A 517 The line containing just a "+" and a space is an empty response from 518 the server. This response contains error information, and in the 519 success case the error response is empty. Like other messages, and 520 in accordance with the IMAP SASL binding, the empty response is 521 base64-encoded. 523 5.2. MAC Authentication with Channel Binding 525 This example shows a channel binding failure. The example sends the 526 same request as above, but in the context of an OAUTH-PLUS exchange 527 the channel binding information is missing. Note that line breaks 528 are inserted for readability. 530 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 531 S: t0 OK Completed 532 C: t1 AUTHENTICATE OAUTH-PLUS aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BdXNlcj11c2 533 VyQGV4YW1wbGUuY29tAXBvcnQ9MTQzAWF1dGg9TUFDIHRva2VuPSJoNDgwZGpzOTNo 534 ZDgiLHRpbWVzdGFtcD0iMTM3MTMxMjAwIixub25jZT0iZGo4M2hzOXMiLHNpZ25hdH 535 VyZT0iWVRWanlOU3VqWXMxV3NEdXJGbnZGaTRKSzZvPSIBY2JkYXRhPVNHOTNJR0pw 536 WnlCcGN5QmhJRlJNVXlCbWFXNWhiQ0J0WlhOellXZGxQd289AQE= 537 S: + 538 S: t1 OK SASL authentication succeeded 540 As required by IMAP [RFC3501], the payloads are base64-encoded. The 541 decoded initial client response (with %x01 represented as ^A and long 542 lines wrapped for readability) is: 544 - 545 host=server.example.com^A 546 user=user@example.com^A 547 port=143^A 548 auth=MAC token="h480djs93hd8",timestamp="137131200",nonce="dj83hs9s", 549 signature="YTVjyNSujYs1WsDurFnvFi4JK6o="^A 550 cbdata=SG93IGJpZyBpcyBhIFRMUyBmaW5hbCBtZXNzYWdlPwo=^A^A 552 The line containing just a "+" and a space is an empty response from 553 the server. This response contains discovery information, and in the 554 success case no discovery information is necessary so the response is 555 empty. Like other messages, and in accordance with the IMAP SASL 556 binding, the empty response is base64-encoded. 558 5.3. Failed Exchange 560 This example shows a failed exchange because of the empty 561 Authorization header, which is how a client can query for the needed 562 scope. Note that line breaks are inserted for readability. 564 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 565 S: t0 OK Completed 566 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BdXNlcj11 567 c2VyQGV4YW1wbGUuY29tAXBvcnQ9MTQzAWF1dGg9AQE= 568 S: + eyJzdGF0dXMiOiI0MDEiLCJzY2hlbWVzIjoiYmVhcmVyIG1hYyIsInNjb3Bl 569 IjoiZXhhbXBsZV9zY29wZSJ9 570 S: t1 NO SASL authentication failed 572 The decoded initial client response is: 574 host=server.example.com^Auser=user@example.com^Aport=143^Aauth=^A^A 575 The decoded server error response is: 577 { 578 "status":"401", 579 "schemes":"bearer mac", 580 "scope":"example_scope" 581 } 583 5.4. Failed Channel Binding 585 This example shows a channel binding failure in an empty request. 586 The channel binding information is empty. Note that line breaks are 587 inserted for readability. 589 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 590 S: t0 OK Completed 591 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BdXNlcj11 592 c2VyQGV4YW1wbGUuY29tAXBvcnQ9MTQzAWF1dGg9AWNiZGF0YT0BAQ== 593 S: + eyJzdGF0dXMiOiI0MTIiLCJzY2hlbWVzIjoiYmVhcmVyIG1hYyIsInNjb3Bl 594 IjoiZXhhbXBsZV9zY29wZSJ9 595 S: t1 NO SASL authentication failed 597 The decoded initial client response is: 599 host=server.example.com^Auser=user@example.com^Aport=143^A 600 auth=^Acbdata=^A^A 602 The decoded server response is: 604 { 605 "status":"412", 606 "schemes":"bearer mac", 607 "scope":"example_scope" 608 } 610 6. Security Considerations 612 This mechanism does not provide a security layer, but does provide a 613 provision for channel binding. The OAuth 2 specification 614 [I-D.ietf-oauth-v2] allows for a variety of usages, and the security 615 properties of these profiles vary. The usage of bearer tokens, for 616 example, provide security features similar to cookies. Applications 617 using this mechanism SHOULD exercise the same level of care using 618 this mechanism as they would in using the SASL PLAIN mechanism. In 619 particular, TLS 1.2 or an equivalent secure channel MUST be 620 implemented and its usage is RECOMMENDED. 622 Channel binding in this mechanism has different properties based on 623 the authentication scheme used. Channel binding to TLS with a bearer 624 token provides only a binding to the TLS layer. Authentication 625 schemes like MAC tokens can implement a signature over the channel 626 binding information. These provide additional protection against a 627 man in the middle attacks, and the MAC authorization header is bound 628 to the channel and only valid in that context. 630 It is possible that SASL will be authenticating a connection and the 631 life of that connection may outlast the life of the token used to 632 authenticate it. This is a common problem in application protocols 633 where connections are long-lived, and not a problem with this 634 mechanism per se. Servers MAY unilaterally disconnect clients in 635 accordance with the application protocol. 637 An OAuth credential is not equivalent to the password or primary 638 account credential. There are protocols like XMPP that allow actions 639 like change password. The server SHOULD ensure that actions taken in 640 the authenticated channel are appropriate to the strength of the 641 presented credential. 643 Tokens have a lifetime associated with them. Reducing the lifetime 644 of a token provides security benefits in case that tokens leak. In 645 addition a previously obtained token MAY be revoked or rendered 646 invalid at any time. The client MAY request a new access token for 647 each connection to a resource server, but it SHOULD cache and re-use 648 access credentials that appear to be valid. 650 7. IANA Considerations 652 7.1. SASL Registration 654 The IANA is requested to register the following SASL profile: 656 SASL mechanism profile: OAUTH 658 Security Considerations: See this document 660 Published Specification: See this document 662 For further information: Contact the authors of this document. 664 Owner/Change controller: the IETF 666 Note: None 668 The IANA is requested to register the following SASL profile: 670 SASL mechanism profile: OAUTH-PLUS 672 Security Considerations: See this document 674 Published Specification: See this document 676 For further information: Contact the authors of this document. 678 Owner/Change controller: the IETF 680 Note: None 682 7.2. GSS-API Registration 684 IANA is further requested to assign an OID for this GSS mechanism in 685 the SMI numbers registry, with the prefix of 686 iso.org.dod.internet.security.mechanisms (1.3.6.1.5.5) and to 687 reference this specification in the registry. 689 8. References 691 8.1. Normative References 693 [I-D.ietf-oauth-v2] 694 Hardt, D., "The OAuth 2.0 Authorization Framework", 695 draft-ietf-oauth-v2-31 (work in progress), August 2012. 697 [I-D.ietf-oauth-v2-bearer] 698 Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 699 Framework: Bearer Token Usage", 700 draft-ietf-oauth-v2-bearer-23 (work in progress), 701 August 2012. 703 [I-D.ietf-oauth-v2-http-mac] 704 Hammer-Lahav, E., "HTTP Authentication: MAC Access 705 Authentication", draft-ietf-oauth-v2-http-mac-01 (work in 706 progress), February 2012. 708 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 709 Requirement Levels", BCP 14, RFC 2119, March 1997. 711 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 712 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 713 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 715 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 716 Leach, P., Luotonen, A., and L. Stewart, "HTTP 717 Authentication: Basic and Digest Access Authentication", 718 RFC 2617, June 1999. 720 [RFC2743] Linn, J., "Generic Security Service Application Program 721 Interface Version 2, Update 1", RFC 2743, January 2000. 723 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 724 (SHA1)", RFC 3174, September 2001. 726 [RFC4422] Melnikov, A. and K. Zeilenga, "Simple Authentication and 727 Security Layer (SASL)", RFC 4422, June 2006. 729 [RFC4627] Crockford, D., "The application/json Media Type for 730 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 732 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 733 Channels", RFC 5056, November 2007. 735 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 736 Specifications: ABNF", STD 68, RFC 5234, January 2008. 738 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 739 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 741 [RFC5801] Josefsson, S. and N. Williams, "Using Generic Security 742 Service Application Program Interface (GSS-API) Mechanisms 743 in Simple Authentication and Security Layer (SASL): The 744 GS2 Mechanism Family", RFC 5801, July 2010. 746 [RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, 747 April 2010. 749 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 750 for TLS", RFC 5929, July 2010. 752 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010. 754 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 755 Verification of Domain-Based Application Service Identity 756 within Internet Public Key Infrastructure Using X.509 757 (PKIX) Certificates in the Context of Transport Layer 758 Security (TLS)", RFC 6125, March 2011. 760 8.2. Informative References 762 [I-D.jones-appsawg-webfinger] 763 Jones, P., Salgueiro, G., and J. Smarr, "WebFinger", 764 draft-jones-appsawg-webfinger-06 (work in progress), 765 June 2012. 767 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 768 4rev1", RFC 3501, March 2003. 770 Appendix A. Document History 772 [[ to be removed by RFC editor before publication as an RFC ]] 774 -03 776 o Added user field into examples and fixed egregious errors there as 777 well. 779 o Added text reminding developers that Authorization scheme names 780 are case insensitive. 782 -02 784 o Added the user data element back in. 786 o Minor editorial changes. 788 -01 790 o Ripping out discovery. Changed to refer to I-D.jones-appsawg- 791 webfinger instead of WF and SWD older drafts. 793 o Replacing HTTP as the message format and adjusted all examples. 795 -00 797 o Renamed draft into proper IETF naming format now that it's 798 adopted. 800 o Minor fixes. 802 -00 804 o Initial revision 806 Authors' Addresses 808 William Mills 809 Yahoo! Inc. 811 Phone: 812 Email: wmills@yahoo-inc.com 814 Tim Showalter 816 Phone: 817 Email: tjs@psaux.com 819 Hannes Tschofenig 820 Nokia Siemens Networks 821 Linnoitustie 6 822 Espoo 02600 823 Finland 825 Phone: +358 (50) 4871445 826 Email: Hannes.Tschofenig@gmx.net 827 URI: http://www.tschofenig.priv.at