idnits 2.17.1 draft-ietf-kitten-sasl-oauth-02.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 4, 2012) is 4276 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 701, but no explicit reference was found in the text == Unused Reference: 'RFC2617' is defined on line 705, but no explicit reference was found in the text == Unused Reference: 'RFC5929' is defined on line 739, but no explicit reference was found in the text == Unused Reference: 'RFC5988' is defined on line 742, 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 5, 2013 6 H. Tschofenig 7 Nokia Siemens Networks 8 August 4, 2012 10 A SASL and GSS-API Mechanism for OAuth 11 draft-ietf-kitten-sasl-oauth-02 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 5, 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 authroization 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 long lines wrapped for readability) below: 389 host=server.example.com^A 390 port=143^A 391 auth=MAC token="h480djs93hd8",timestamp="137131200",nonce="dj83hs9s", 392 signature="YTVjyNSujYs1WsDurFnvFi4JK6o="^A^A 394 The normalized request string would be constructed per the MAC 395 specification [I-D.ietf-oauth-v2-http-mac]. In this example the 396 normalized request string with the new line separator character is 397 represented by "\n" for display purposes only would be: 399 h480djs93hi8\n 400 137131200\n 401 dj83hs9s\n 402 \n 403 GET\n 404 server.example.com\n 405 143\n 406 /\n 407 \n 409 3.4. Channel Binding 411 If the specification for the underlying authorization scheme requires 412 a security layer, such as TLS [RFC5246], the server SHOULD only offer 413 a mechanism where channel binding can be enabled. 415 The channel binding data is computed by the client based on it's 416 choice of preferred channel binding type. As specified in [RFC5056], 417 the channel binding information MUST start with the channel binding 418 unique prefix, followed by a colon (ASCII 0x3A), followed by a base64 419 encoded channel binding payload. The channel binding payload is the 420 raw data from the channel binding type if the raw channel binding 421 data is less than 500 bytes. If the raw channel binding data is 500 422 bytes or larger then a SHA-1 [RFC3174] hash of the raw channel 423 binding data is computed. 425 If the client is using tls-unique for a channel binding then the raw 426 channel binding data equals the first TLS finished message. This is 427 under the 500 byte limit, so the channel binding payload sent to the 428 server would be the base64 encoded first TLS finished message. 430 In the case where the client has chosen tls-endpoint, the raw channel 431 binding data is the certificate of the server the client connected 432 to, which will frequently be 500 bytes or more. If it is then the 433 channel binding payload is the base64 encoded SHA-1 hash of the 434 server certificate. 436 4. GSS-API OAuth Mechanism Specification 438 Note: The normative references in this section are informational for 439 SASL implementers, but they are normative for GSS-API implementers. 441 The SASL OAuth mechanism is also a GSS-API mechanism and the messages 442 described in Section 3 are the same, but 444 1. the GS2 header on the client's first message is excluded when 445 OAUTH is used as a GSS-API mechanism, and 447 2. initial context token header is prefixed to the client's first 448 authentication message (context token), as described in Section 449 3.1 of RFC 2743, 451 The GSS-API mechanism OID for OAuth is [[TBD: IANA]]. 453 OAuth security contexts always have the mutual_state flag 454 (GSS_C_MUTUAL_FLAG) set to TRUE. OAuth supports credential 455 delegation, therefore security contexts may have the deleg_state flag 456 (GSS_C_DELEG_FLAG) set to either TRUE or FALSE. 458 The mutual authentication property of this mechanism relies on 459 successfully comparing the TLS server identity with the negotiated 460 target name. Since the TLS channel is managed by the application 461 outside of the GSS-API mechanism, the mechanism itself is unable to 462 confirm the name while the application is able to perform this 463 comparison for the mechanism. For this reason, applications MUST 464 match the TLS server identity with the target name, as discussed in 465 [RFC6125]. 467 The OAuth mechanism does not support per-message tokens or 468 GSS_Pseudo_random. 470 OAuth supports a standard generic name syntax for acceptors, such as 471 GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], Section 4.1). These 472 service names MUST be associated with the "entityID" claimed by the 473 RP. OAuth supports only a single name type for initiators: 474 GSS_C_NT_USER_NAME. GSS_C_NT_USER_NAME is the default name type. 475 The query, display, and exported name syntaxes for OAuth principal 476 names are all the same. There is no OAuth-specific name syntax; 477 applications SHOULD use generic GSS-API name types, such as 478 GSS_C_NT_USER_NAME and GSS_C_NT_HOSTBASED_SERVICE (see [RFC2743], 479 Section 4). The exported name token does, of course, conform to 480 [RFC2743], Section 3.2, but the "NAME" part of the token should be 481 treated as a potential input string to the OAuth name normalization 482 rules. 484 5. Examples 486 These example illustrate exchanges between an IMAP client and an IMAP 487 server. 489 5.1. Successful Bearer Token Exchange 491 This example shows a successful OAuth 2.0 bearer token exchange with 492 an initial client response. Note that line breaks are inserted for 493 readability. 495 S: * IMAP4rev1 Server Ready 496 C: t0 CAPABILITY 497 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH 498 S: t0 OK Completed 499 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xNDMB 500 YXV0aD1CRUFSRVIgdkY5ZGZ0NHFtVGMyTnZiM1JsY2tCaGJIUmhkbWx6ZEdFdVk 501 yOXRDZz09AQE= 502 S: + 503 S: t1 OK SASL authentication succeeded 505 As required by IMAP [RFC3501], the payloads are base64-encoded. The 506 decoded initial client response (with %x01 represented as ^A and long 507 lines wrapped for readability) is: 509 host=server.example.com^Aport=143^A 510 auth=BEARER "vF9dft4qmTc2Nvb3RlckBhbHRhdmlzdGEuY29tCg=="^A^A 512 The line containing just a "+" and a space is an empty response from 513 the server. This response contains error information, and in the 514 success case the error response is empty. Like other messages, and 515 in accordance with the IMAP SASL binding, the empty response is 516 base64-encoded. 518 5.2. MAC Authentication with Channel Binding 520 This example shows a channel binding failure. The example sends the 521 same request as above, but in the context of an OAUTH-PLUS exchange 522 the channel binding information is missing. Note that line breaks 523 are inserted for readability. 525 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 526 S: t0 OK Completed 527 C: t1 AUTHENTICATE MAC aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xNDMBYXV0a 528 D1NQUMgdG9rZW49Img0ODBkanM5M2hkOCIsdGltZXN0YW1wPSIxMzcxMzEyMDAiLG5vbm 529 NlPSJkajgzaHM5cyIsc2lnbmF0dXJlPSJZVFZqeU5TdWpZczFXc0R1ckZudkZpNEpLNm8 530 9IgFjYmRhdGE9U0c5M0lHSnBaeUJwY3lCaElGUk1VeUJtYVc1aGJDQnRaWE56WVdkbFB3 531 bz0BAQ== 532 S: + 533 S: t1 OK SASL authentication succeeded 535 As required by IMAP [RFC3501], the payloads are base64-encoded. The 536 decoded initial client response (with %x01 represented as ^A and long 537 lines wrapped for readability) is: 539 - 540 host=server.example.com^A 541 port=143^A 542 auth=MAC token="h480djs93hd8",timestamp="137131200",nonce="dj83hs9s", 543 signature="YTVjyNSujYs1WsDurFnvFi4JK6o="^A 544 cbdata=SG93IGJpZyBpcyBhIFRMUyBmaW5hbCBtZXNzYWdlPwo=^A^A 546 The line containing just a "+" and a space is an empty response from 547 the server. This response contains discovery information, and in the 548 success case no discovery information is necessary so the response is 549 empty. Like other messages, and in accordance with the IMAP SASL 550 binding, the empty response is base64-encoded. 552 5.3. Failed Exchange 554 This example shows a failed exchange because of the empty 555 Authorization header, which is how a client can query for the needed 556 scope. Note that line breaks are inserted for readability. 558 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 559 S: t0 OK Completed 560 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xND 561 MBYXV0aD0BAQ== 562 S: + ewoic3RhdHVzIjoiNDAxIiwKInNjb3BlIjoiZXhhbXBsZV9zY29wZSIKfQo= 563 S: t1 NO SASL authentication failed 565 The decoded initial client response is: 567 host=server.example.com^Aport=143^Aauth=^A^A 569 The decoded server error response is: 571 { 572 "status":"401", 573 "scope":"example_scope" 574 } 576 5.4. Failed Channel Binding 578 This example shows a channel binding failure in an empty request. 579 The channel binding information is empty. Note that line breaks are 580 inserted for readability. 582 S: * CAPABILITY IMAP4rev1 AUTH=OAUTH SASL-IR IMAP4rev1 Server Ready 583 S: t0 OK Completed 584 C: t1 AUTHENTICATE OAUTH aG9zdD1zZXJ2ZXIuZXhhbXBsZS5jb20BcG9ydD0xND 585 MBYXV0aD0BY2JkYXRhPQEB 586 S: + ewoic3RhdHVzIjoiNDEyIiwKInNjb3BlIjoiZXhhbXBsZV9zY29wZSIKfQ== 587 S: t1 NO SASL authentication failed 589 The decoded initial client response is: 591 host=server.example.com^Aport=143^Aauth=^Acbdata=^A^A 593 The decoded server response is: 595 { 596 "status":"412", 597 "scope":"example_scope" 598 } 600 6. Security Considerations 602 This mechanism does not provide a security layer, but does provide a 603 provision for channel binding. The OAuth 2 specification 604 [I-D.ietf-oauth-v2] allows for a variety of usages, and the security 605 properties of these profiles vary. The usage of bearer tokens, for 606 example, provide security features similar to cookies. Applications 607 using this mechanism SHOULD exercise the same level of care using 608 this mechanism as they would in using the SASL PLAIN mechanism. In 609 particular, TLS 1.2 or an equivalent secure channel MUST be 610 implemented and its usage is RECOMMENDED. 612 Channel binding in this mechanism has different properties based on 613 the authentication scheme used. Channel binding to TLS with a bearer 614 token provides only a binding to the TLS layer. Authentication 615 schemes like MAC tokens can implement a signature over the channel 616 binding information. These provide additional protection against a 617 man in the middle attacks, and the MAC authorization header is bound 618 to the channel and only valid in that context. 620 It is possible that SASL will be authenticating a connection and the 621 life of that connection may outlast the life of the token used to 622 authenticate it. This is a common problem in application protocols 623 where connections are long-lived, and not a problem with this 624 mechanism per se. Servers MAY unilaterally disconnect clients in 625 accordance with the application protocol. 627 An OAuth credential is not equivalent to the password or primary 628 account credential. There are protocols like XMPP that allow actions 629 like change password. The server SHOULD ensure that actions taken in 630 the authenticated channel are appropriate to the strength of the 631 presented credential. 633 Tokens have a lifetime associated with them. Reducing the lifetime 634 of a token provides security benefits in case that tokens leak. In 635 addition a previously obtained token MAY be revoked or rendered 636 invalid at any time. The client MAY request a new access token for 637 each connection to a resource server, but it SHOULD cache and re-use 638 access credentials that appear to be valid. 640 7. IANA Considerations 642 7.1. SASL Registration 644 The IANA is requested to register the following SASL profile: 646 SASL mechanism profile: OAUTH 648 Security Considerations: See this document 650 Published Specification: See this document 652 For further information: Contact the authors of this document. 654 Owner/Change controller: the IETF 656 Note: None 658 The IANA is requested to register the following SASL profile: 660 SASL mechanism profile: OAUTH-PLUS 662 Security Considerations: See this document 664 Published Specification: See this document 666 For further information: Contact the authors of this document. 668 Owner/Change controller: the IETF 670 Note: None 672 7.2. GSS-API Registration 674 IANA is further requested to assign an OID for this GSS mechanism in 675 the SMI numbers registry, with the prefix of 676 iso.org.dod.internet.security.mechanisms (1.3.6.1.5.5) and to 677 reference this specification in the registry. 679 8. References 681 8.1. Normative References 683 [I-D.ietf-oauth-v2] 684 Hardt, D., "The OAuth 2.0 Authorization Framework", 685 draft-ietf-oauth-v2-31 (work in progress), August 2012. 687 [I-D.ietf-oauth-v2-bearer] 688 Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 689 Framework: Bearer Token Usage", 690 draft-ietf-oauth-v2-bearer-23 (work in progress), 691 August 2012. 693 [I-D.ietf-oauth-v2-http-mac] 694 Hammer-Lahav, E., "HTTP Authentication: MAC Access 695 Authentication", draft-ietf-oauth-v2-http-mac-01 (work in 696 progress), February 2012. 698 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 699 Requirement Levels", BCP 14, RFC 2119, March 1997. 701 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 702 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 703 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 705 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 706 Leach, P., Luotonen, A., and L. Stewart, "HTTP 707 Authentication: Basic and Digest Access Authentication", 708 RFC 2617, June 1999. 710 [RFC2743] Linn, J., "Generic Security Service Application Program 711 Interface Version 2, Update 1", RFC 2743, January 2000. 713 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 714 (SHA1)", RFC 3174, September 2001. 716 [RFC4422] Melnikov, A. and K. Zeilenga, "Simple Authentication and 717 Security Layer (SASL)", RFC 4422, June 2006. 719 [RFC4627] Crockford, D., "The application/json Media Type for 720 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 722 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 723 Channels", RFC 5056, November 2007. 725 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 726 Specifications: ABNF", STD 68, RFC 5234, January 2008. 728 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 729 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 731 [RFC5801] Josefsson, S. and N. Williams, "Using Generic Security 732 Service Application Program Interface (GSS-API) Mechanisms 733 in Simple Authentication and Security Layer (SASL): The 734 GS2 Mechanism Family", RFC 5801, July 2010. 736 [RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, 737 April 2010. 739 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 740 for TLS", RFC 5929, July 2010. 742 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010. 744 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 745 Verification of Domain-Based Application Service Identity 746 within Internet Public Key Infrastructure Using X.509 747 (PKIX) Certificates in the Context of Transport Layer 748 Security (TLS)", RFC 6125, March 2011. 750 8.2. Informative References 752 [I-D.jones-appsawg-webfinger] 753 Jones, P., Salgueiro, G., and J. Smarr, "WebFinger", 754 draft-jones-appsawg-webfinger-06 (work in progress), 755 June 2012. 757 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 758 4rev1", RFC 3501, March 2003. 760 Appendix A. Document History 762 [[ to be removed by RFC editor before publication as an RFC ]] 764 -02 766 o Added the user data element back in. 768 o Minor editorial changes. 770 -01 772 o Ripping out discovery. Changed to refer to I-D.jones-appsawg- 773 webfinger instead of WF and SWD older drafts. 775 o Replacing HTTP as the message format and adjusted all examples. 777 -00 779 o Renamed draft into proper IETF naming format now that it's 780 adopted. 782 o Minor fixes. 784 -00 786 o Initial revision 788 Authors' Addresses 790 William Mills 791 Yahoo! Inc. 793 Phone: 794 Email: wmills@yahoo-inc.com 796 Tim Showalter 798 Phone: 799 Email: tjs@psaux.com 801 Hannes Tschofenig 802 Nokia Siemens Networks 803 Linnoitustie 6 804 Espoo 02600 805 Finland 807 Phone: +358 (50) 4871445 808 Email: Hannes.Tschofenig@gmx.net 809 URI: http://www.tschofenig.priv.at