idnits 2.17.1 draft-ietf-kitten-sasl-oauth-01.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 (May 30, 2012) is 4342 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 718, but no explicit reference was found in the text == Unused Reference: 'RFC2617' is defined on line 722, but no explicit reference was found in the text == Unused Reference: 'RFC5929' is defined on line 753, but no explicit reference was found in the text == Unused Reference: 'RFC5988' is defined on line 756, but no explicit reference was found in the text == Outdated reference: A later version (-31) exists of draft-ietf-oauth-v2-26 == Outdated reference: A later version (-23) exists of draft-ietf-oauth-v2-bearer-19 == Outdated reference: A later version (-05) exists of draft-ietf-oauth-v2-http-mac-01 ** Obsolete normative reference: RFC 2234 (Obsoleted by RFC 4234) ** 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) == Outdated reference: A later version (-06) exists of draft-jones-appsawg-webfinger-05 -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) Summary: 9 errors (**), 0 flaws (~~), 10 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: December 1, 2012 6 H. Tschofenig 7 Nokia Siemens Networks 8 May 30, 2012 10 A SASL and GSS-API Mechanism for OAuth 11 draft-ietf-kitten-sasl-oauth-01 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 December 1, 2012. 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 . . . . . . . . . . . . . 8 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 . . . . . . . . . . . . 12 79 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 80 5.1. Successful Bearer Token Exchange . . . . . . . . . . . . . 13 81 5.2. MAC Authentication with Channel Binding . . . . . . . . . 13 82 5.3. Failed Exchange . . . . . . . . . . . . . . . . . . . . . 14 83 5.4. Failed Channel Binding . . . . . . . . . . . . . . . . . . 15 84 6. Security Considerations . . . . . . . . . . . . . . . . . . . 16 85 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 86 7.1. SASL Registration . . . . . . . . . . . . . . . . . . . . 17 87 7.2. GSS-API Registration . . . . . . . . . . . . . . . . . . . 17 88 8. Appendix A -- Document History . . . . . . . . . . . . . . . . 18 89 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 19 90 9.1. Normative References . . . . . . . . . . . . . . . . . . . 19 91 9.2. Informative References . . . . . . . . . . . . . . . . . . 20 92 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 21 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 form an HTTP context in order to be 258 able to complete an OAuth style HTTP authorization. The ABNF 259 [RFC2234] 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 host: Contains the host name to which the client connected. 274 port: Contains the port number represented as a decimal positive 275 integer string without leading zeros to which the client 276 connected. 278 In authorization schemes that use signatures, the client MUST send 279 host and port number key/values, and the server MUST fail 280 authorization request requiring signatures that do not have host and 281 port values. 283 3.1.1. Reserved Key/Values in OAUTH 285 In the OAUTH mechanism values for path, query string and post body 286 are assigned default values. OAuth authorization schemes MAY define 287 usage of these in the SASL context and extend this specification. 288 For OAuth schemes that use request signatures the default values MUST 289 be used unless explict values are provided in the client response. 290 The following key values are reserved for future use: 292 path (RESERVED): HTTP path data, the default value is "/". 294 qs (RESERVED): HTTP query string, the default value is "". 296 post (RESERVED): HTTP post data, the default value is "". 298 3.2. Server's Response 300 The server validates the response per the specification for the 301 authorization scheme used. If the authorization scheme used includes 302 signing of the request parameters the client must provide a client 303 response that satisfies the data requirements for the scheme in use. 305 In the OAUTH-PLUS mechanism the server examines the channel binding 306 data, extracts the channel binding unique prefix, and extracts the 307 raw channel biding data based on the channel binding type used. It 308 then computes it's own copy of the channel binding payload and 309 compares that to the payload sent by the client in the cbdata key/ 310 value. Those two must be equal for channel binding to succeed. 312 The server responds to a successfully verified client message by 313 completing the SASL negotiation. The authentication scheme MUST 314 carry the user ID to be used as the authorization identity (identity 315 to act as). The server MUST use the ID obtained from the credential 316 as the user being authorized. 318 3.2.1. Mapping to SASL Identities 320 Some OAuth mechanisms can provide both an authorization identity and 321 an authentication identity. An example of this is OAuth 1.0a 322 [RFC5849] where the consumer key (oauth_consumer_key) identifies the 323 entity using to token which equates to the SASL authentication 324 identity, and is authenticated using the shared secret. The 325 authorization identity in the OAuth 1.0a case is carried in the token 326 (per the requirement above), which SHOULD validated independently. 327 The server MAY use a consumer key, a value derived from it, or other 328 comparable identity in the OAuth authorization scheme as the SASL 329 authentication identity. If an appropriate authentication identity 330 is not available the server MUST use the authorization identity as 331 the wuthentication identity. 333 3.2.2. Server response to failed authentication. 335 For a failed authentication the server returns a JSON [RFC4627] 336 formatted error result, and fails the authentication. The error 337 result consists of the following values: 339 status (REQUIRED): The authorization error code. Valid error 340 codes are defined in the IANA [[need registry name]] registry 341 specified in the OAuth 2 core specification. 343 scope (OPTIONAL): The OAuth scope required to access the service. 345 If the resource server provides a scope the client SHOULD always 346 request scoped tokens from the token endpoint. The client MAY use a 347 scope other than the one provided by the resource server. Scopes 348 other than those advertised by the resource server are be defined by 349 the resource owner and provided in service documentation or discovery 350 information (which is beyond the scope of this memo). If not present 351 then the client SHOULD presume an empty scope (unscoped token) is 352 needed. 354 If channel binding is in use and the channel binding fails the server 355 responds with a status code set to 412 to indicate that the channel 356 binding precondition failed. If the authentication scheme in use 357 does not include signing the server SHOULD revoke the presented 358 credential and the client SHOULD discard that credential. 360 3.3. Use of Signature Type Authorization 362 This mechanism supports authorization using signatures, which 363 requires that both client and server construct the string to be 364 signed. OAuth 2 is designed for authentication/authorization to 365 access specific URIs. SASL is designed for user authentication, and 366 has no facility for being more specific. In this mechanism we 367 require or define default values for the data elements from an HTTP 368 request which allow the signature base string to be constructed 369 properly. The default HTTP path is "/" and the default post body is 370 empty. These atoms are defined as extension points so that no 371 changes are needed if there is a revision of SASL which supports more 372 specific resource authorization, e.g. IMAP access to a specific 373 folder or FTP access limited to a specific directory. 375 Using the example in the MAC specification 376 [I-D.ietf-oauth-v2-http-mac] as a starting point, on an IMAP server 377 running on port 143 and given the MAC style authorization request 378 (with %x01 shown as ^A and long lines wrapped for readability) below: 380 host=server.example.com^A 381 port=143^A 382 auth=MAC token="h480djs93hd8",timestamp="137131200",nonce="dj83hs9s", 383 signature="YTVjyNSujYs1WsDurFnvFi4JK6o="^A^A 385 The normalized request string would be constructed per the MAC 386 specification [I-D.ietf-oauth-v2-http-mac]. In this example the 387 normalized request string with the new line separator character is 388 represented by "\n" for display purposes only would be: 390 h480djs93hi8\n 391 137131200\n 392 dj83hs9s\n 393 \n 394 GET\n 395 server.example.com\n 396 143\n 397 /\n 398 \n 400 3.4. Channel Binding 402 If the specification for the underlying authorization scheme requires 403 a security layer, such as TLS [RFC5246], the server SHOULD only offer 404 a mechanism where channel binding can be enabled. 406 The channel binding data is computed by the client based on it's 407 choice of preferred channel binding type. As specified in [RFC5056], 408 the channel binding information MUST start with the channel binding 409 unique prefix, followed by a colon (ASCII 0x3A), followed by a base64 410 encoded channel binding payload. The channel binding payload is the 411 raw data from the channel binding type if the raw channel binding 412 data is less than 500 bytes. If the raw channel binding data is 500 413 bytes or larger then a SHA-1 [RFC3174] hash of the raw channel 414 binding data is computed. 416 If the client is using tls-unique for a channel binding then the raw 417 channel binding data equals the first TLS finished message. This is 418 under the 500 byte limit, so the channel binding payload sent to the 419 server would be the base64 encoded first TLS finished message. 421 In the case where the client has chosen tls-endpoint, the raw channel 422 binding data is the certificate of the server the client connected 423 to, which will frequently be 500 bytes or more. If it is then the 424 channel binding payload is the base64 encoded SHA-1 hash of the 425 server certificate. 427 4. GSS-API OAuth Mechanism Specification 429 Note: The normative references in this section are informational for 430 SASL implementers, but they are normative for GSS-API implementers. 432 The SASL OAuth mechanism is also a GSS-API mechanism and the messages 433 described in Section 3 are the same, but 435 1. the GS2 header on the client's first message is excluded when 436 OAUTH is used as a GSS-API mechanism, and 438 2. initial context token header is prefixed to the client's first 439 authentication message (context token), as described in Section 440 3.1 of RFC 2743, 442 The GSS-API mechanism OID for OAuth is [[TBD: IANA]]. 444 OAuth security contexts always have the mutual_state flag 445 (GSS_C_MUTUAL_FLAG) set to TRUE. OAuth supports credential 446 delegation, therefore security contexts may have the deleg_state flag 447 (GSS_C_DELEG_FLAG) set to either TRUE or FALSE. 449 The mutual authentication property of this mechanism relies on 450 successfully comparing the TLS server identity with the negotiated 451 target name. Since the TLS channel is managed by the application 452 outside of the GSS-API mechanism, the mechanism itself is unable to 453 confirm the name while the application is able to perform this 454 comparison for the mechanism. For this reason, applications MUST 455 match the TLS server identity with the target name, as discussed in 456 [RFC6125]. 458 The OAuth mechanism does not support per-message tokens or 459 GSS_Pseudo_random. 461 OAuth supports a standard generic name syntax for acceptors, such as 462 GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], Section 4.1). These 463 service names MUST be associated with the "entityID" claimed by the 464 RP. OAuth supports only a single name type for initiators: 465 GSS_C_NT_USER_NAME. GSS_C_NT_USER_NAME is the default name type. 466 The query, display, and exported name syntaxes for OAuth principal 467 names are all the same. There is no OAuth-specific name syntax; 468 applications SHOULD use generic GSS-API name types, such as 469 GSS_C_NT_USER_NAME and GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], 470 Section 4). The exported name token does, of course, conform to 471 [RFC2743], Section 3.2, but the "NAME" part of the token should be 472 treated as a potential input string to the OAuth name normalization 473 rules. 475 5. Examples 477 These example illustrate exchanges between an IMAP client and an IMAP 478 server. 480 5.1. Successful Bearer Token Exchange 482 This example shows a successful OAuth 2.0 bearer token exchange with 483 an initial client response. Note that line breaks are inserted for 484 readability. 486 S: * IMAP4rev1 Server Ready 487 C: t0 CAPABILITY 488 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH 489 S: t0 OK Completed 490 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xNDMB 491 YXV0aD1CRUFSRVIgdkY5ZGZ0NHFtVGMyTnZiM1JsY2tCaGJIUmhkbWx6ZEdFdVk 492 yOXRDZz09AQE= 493 S: + 494 S: t1 OK SASL authentication succeeded 496 As required by IMAP [RFC3501], the payloads are base64-encoded. The 497 decoded initial client response (with %x01 represented as ^A and long 498 lines wrapped for readability) is: 500 host=server.example.com^Aport=143^A 501 auth=BEARER "vF9dft4qmTc2Nvb3RlckBhbHRhdmlzdGEuY29tCg=="^A^A 503 The line containing just a "+" and a space is an empty response from 504 the server. This response contains error information, and in the 505 success case the error response is empty. Like other messages, and 506 in accordance with the IMAP SASL binding, the empty response is 507 base64-encoded. 509 5.2. MAC Authentication with Channel Binding 511 This example shows a channel binding failure. The example sends the 512 same request as above, but in the context of an OAUTH-PLUS exchange 513 the channel binding information is missing. Note that line breaks 514 are inserted for readability. 516 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 517 S: t0 OK Completed 518 C: t1 AUTHENTICATE MAC aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xNDMBYXV0a 519 D1NQUMgdG9rZW49Img0ODBkanM5M2hkOCIsdGltZXN0YW1wPSIxMzcxMzEyMDAiLG5vbm 520 NlPSJkajgzaHM5cyIsc2lnbmF0dXJlPSJZVFZqeU5TdWpZczFXc0R1ckZudkZpNEpLNm8 521 9IgFjYmRhdGE9U0c5M0lHSnBaeUJwY3lCaElGUk1VeUJtYVc1aGJDQnRaWE56WVdkbFB3 522 bz0BAQ== 523 S: + 524 S: t1 OK SASL authentication succeeded 526 As required by IMAP [RFC3501], the payloads are base64-encoded. The 527 decoded initial client response (with %x01 represented as ^A and long 528 lines wrapped for readability) is: 530 - 531 host=server.example.com^A 532 port=143^A 533 auth=MAC token="h480djs93hd8",timestamp="137131200",nonce="dj83hs9s", 534 signature="YTVjyNSujYs1WsDurFnvFi4JK6o="^A 535 cbdata=SG93IGJpZyBpcyBhIFRMUyBmaW5hbCBtZXNzYWdlPwo=^A^A 537 The line containing just a "+" and a space is an empty response from 538 the server. This response contains discovery information, and in the 539 success case no discovery information is necessary so the response is 540 empty. Like other messages, and in accordance with the IMAP SASL 541 binding, the empty response is base64-encoded. 543 5.3. Failed Exchange 545 This example shows a failed exchange because of the empty 546 Authorization header, which is how a client can query for the needed 547 scope. Note that line breaks are inserted for readability. 549 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 550 S: t0 OK Completed 551 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xND 552 MBYXV0aD0BAQ== 553 S: + ewoic3RhdHVzIjoiNDAxIiwKInNjb3BlIjoiZXhhbXBsZV9zY29wZSIKfQo= 554 S: t1 NO SASL authentication failed 556 The decoded initial client response is: 558 host=server.example.com^Aport=143^Aauth=^A^A 560 The decoded server error response is: 562 { 563 "status":"401", 564 "scope":"example_scope" 565 } 567 5.4. Failed Channel Binding 569 This example shows a channel binding failure in an empty request. 570 The channel binding information is empty. Note that line breaks are 571 inserted for readability. 573 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 574 S: t0 OK Completed 575 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xND 576 MBYXV0aD0BY2JkYXRhPQEB 577 S: + ewoic3RhdHVzIjoiNDEyIiwKInNjb3BlIjoiZXhhbXBsZV9zY29wZSIKfQ== 578 S: t1 NO SASL authentication failed 580 The decoded initial client response is: 582 host=server.example.com^Aport=143^Aauth=^Acbdata=^A^A 584 The decoded server response is: 586 { 587 "status":"412", 588 "scope":"example_scope" 589 } 591 6. Security Considerations 593 This mechanism does not provide a security layer, but does provide a 594 provision for channel binding. The OAuth 2 specification 595 [I-D.ietf-oauth-v2] allows for a variety of usages, and the security 596 properties of these profiles vary. The usage of bearer tokens, for 597 example, provide security features similar to cookies. Applications 598 using this mechanism SHOULD exercise the same level of care using 599 this mechanism as they would in using the SASL PLAIN mechanism. In 600 particular, TLS 1.2 or an equivalent secure channel MUST be 601 implemented and its usage is RECOMMENDED. 603 Channel binding in this mechanism has different properties based on 604 the authentication scheme used. Channel binding to TLS with a bearer 605 token provides only a binding to the TLS layer. Authentication 606 schemes like MAC tokens can implement a signature over the channel 607 binding information. These provide additional protection against a 608 man in the middle attacks, and the MAC authorization header is bound 609 to the channel and only valid in that context. 611 It is possible that SASL will be authenticating a connection and the 612 life of that connection may outlast the life of the token used to 613 authenticate it. This is a common problem in application protocols 614 where connections are long-lived, and not a problem with this 615 mechanism per se. Servers MAY unilaterally disconnect clients in 616 accordance with the application protocol. 618 An OAuth credential is not equivalent to the password or primary 619 account credential. There are protocols like XMPP that allow actions 620 like change password. The server SHOULD ensure that actions taken in 621 the authenticated channel are appropriate to the strength of the 622 presented credential. 624 Tokens have a lifetime associated with them. Reducing the lifetime 625 of a token provides security benefits in case that tokens leak. In 626 addition a previously obtained token MAY be revoked or rendered 627 invalid at any time. The client MAY request a new access token for 628 each connection to a resource server, but it SHOULD cache and re-use 629 access credentials that appear to be valid. 631 7. IANA Considerations 633 7.1. SASL Registration 635 The IANA is requested to register the following SASL profile: 637 SASL mechanism profile: OAUTH 639 Security Considerations: See this document 641 Published Specification: See this document 643 For further information: Contact the authors of this document. 645 Owner/Change controller: the IETF 647 Note: None 649 The IANA is requested to register the following SASL profile: 651 SASL mechanism profile: OAUTH-PLUS 653 Security Considerations: See this document 655 Published Specification: See this document 657 For further information: Contact the authors of this document. 659 Owner/Change controller: the IETF 661 Note: None 663 7.2. GSS-API Registration 665 IANA is further requested to assign an OID for this GSS mechanism in 666 the SMI numbers registry, with the prefix of 667 iso.org.dod.internet.security.mechanisms (1.3.6.1.5.5) and to 668 reference this specification in the registry. 670 8. Appendix A -- Document History 672 [[ to be removed by RFC editor before publication as an RFC ]] 674 -01 676 o Ripping out discovery. Changed to refer to I-D.jones-appsawg- 677 webfinger instead of WF and SWD older drafts. 679 o Replacing HTTP as the message format and adjusted all examples. 681 -00 683 o Renamed draft into proper IETF naming format now that it's 684 adopted. 686 o Minor fixes. 688 -00 690 o Initial revision 692 9. References 694 9.1. Normative References 696 [I-D.ietf-oauth-v2] 697 Hammer-Lahav, E., Recordon, D., and D. Hardt, "The OAuth 698 2.0 Authorization Framework", draft-ietf-oauth-v2-26 (work 699 in progress), May 2012. 701 [I-D.ietf-oauth-v2-bearer] 702 Jones, M., Hardt, D., and D. Recordon, "The OAuth 2.0 703 Authorization Protocol: Bearer Tokens", 704 draft-ietf-oauth-v2-bearer-19 (work in progress), 705 April 2012. 707 [I-D.ietf-oauth-v2-http-mac] 708 Hammer-Lahav, E., "HTTP Authentication: MAC Access 709 Authentication", draft-ietf-oauth-v2-http-mac-01 (work in 710 progress), February 2012. 712 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 713 Requirement Levels", BCP 14, RFC 2119, March 1997. 715 [RFC2234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 716 Specifications: ABNF", RFC 2234, November 1997. 718 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 719 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 720 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 722 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 723 Leach, P., Luotonen, A., and L. Stewart, "HTTP 724 Authentication: Basic and Digest Access Authentication", 725 RFC 2617, June 1999. 727 [RFC2743] Linn, J., "Generic Security Service Application Program 728 Interface Version 2, Update 1", RFC 2743, January 2000. 730 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 731 (SHA1)", RFC 3174, September 2001. 733 [RFC4422] Melnikov, A. and K. Zeilenga, "Simple Authentication and 734 Security Layer (SASL)", RFC 4422, June 2006. 736 [RFC4627] Crockford, D., "The application/json Media Type for 737 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 739 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 740 Channels", RFC 5056, November 2007. 742 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 743 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 745 [RFC5801] Josefsson, S. and N. Williams, "Using Generic Security 746 Service Application Program Interface (GSS-API) Mechanisms 747 in Simple Authentication and Security Layer (SASL): The 748 GS2 Mechanism Family", RFC 5801, July 2010. 750 [RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, 751 April 2010. 753 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 754 for TLS", RFC 5929, July 2010. 756 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010. 758 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 759 Verification of Domain-Based Application Service Identity 760 within Internet Public Key Infrastructure Using X.509 761 (PKIX) Certificates in the Context of Transport Layer 762 Security (TLS)", RFC 6125, March 2011. 764 9.2. Informative References 766 [I-D.jones-appsawg-webfinger] 767 Jones, P., Salgueiro, G., and J. Smarr, "WebFinger", 768 draft-jones-appsawg-webfinger-05 (work in progress), 769 May 2012. 771 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 772 4rev1", RFC 3501, March 2003. 774 Authors' Addresses 776 William Mills 777 Yahoo! Inc. 779 Phone: 780 Email: wmills@yahoo-inc.com 782 Tim Showalter 784 Phone: 785 Email: tjs@psaux.com 787 Hannes Tschofenig 788 Nokia Siemens Networks 789 Linnoitustie 6 790 Espoo 02600 791 Finland 793 Phone: +358 (50) 4871445 794 Email: Hannes.Tschofenig@gmx.net 795 URI: http://www.tschofenig.priv.at