idnits 2.17.1 draft-ietf-kitten-sasl-oauth-12.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document date (December 15, 2013) is 3785 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: 'RFC3174' is defined on line 662, but no explicit reference was found in the text == Unused Reference: 'RFC5056' is defined on line 674, but no explicit reference was found in the text == Unused Reference: 'RFC5246' is defined on line 680, but no explicit reference was found in the text ** 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) == Outdated reference: A later version (-32) exists of draft-ietf-oauth-json-web-token-13 == Outdated reference: A later version (-05) exists of draft-ietf-oauth-v2-http-mac-04 -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) Summary: 4 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: June 18, 2014 6 H. Tschofenig 7 Nokia Solutions and Networks 8 December 15, 2013 10 A set of SASL Mechanisms for OAuth 11 draft-ietf-kitten-sasl-oauth-12.txt 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 credentials 21 obtained via OAuth over the Simple Authentication and Security Layer 22 (SASL) to access a protected resource at a resource serve. Thereby, 23 it enables schemes defined within the OAuth framework for non-HTTP- 24 based application protocols. 26 Clients typically store the user's long-term credential. This does, 27 however, lead to significant security vulnerabilities, for example, 28 when such a credential leaks. A significant benefit of OAuth for 29 usage in those clients is that the password is replaced by a shared 30 secret with higher entropy, i.e., the token. Tokens typically 31 provide limited access rights and can be managed and revoked 32 separately from the user's long-term password. 34 Status of This Memo 36 This Internet-Draft is submitted in full conformance with the 37 provisions of BCP 78 and BCP 79. 39 Internet-Drafts are working documents of the Internet Engineering 40 Task Force (IETF). Note that other groups may also distribute 41 working documents as Internet-Drafts. The list of current Internet- 42 Drafts is at http://datatracker.ietf.org/drafts/current/. 44 Internet-Drafts are draft documents valid for a maximum of six months 45 and may be updated, replaced, or obsoleted by other documents at any 46 time. It is inappropriate to use Internet-Drafts as reference 47 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on June 18, 2014. 50 Copyright Notice 52 Copyright (c) 2013 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (http://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 68 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 69 3. OAuth SASL Mechanism Specifications . . . . . . . . . . . . . 6 70 3.1. Initial Client Response . . . . . . . . . . . . . . . . . 7 71 3.1.1. Reserved Key/Values . . . . . . . . . . . . . . . . . 7 72 3.2. Server's Response . . . . . . . . . . . . . . . . . . . . 8 73 3.2.1. OAuth Identifiers in the SASL Context . . . . . . . . 8 74 3.2.2. Server Response to Failed Authentication . . . . . . 8 75 3.2.3. Completing an Error Message Sequence . . . . . . . . 9 76 3.3. OAuth Access Token Types using Keyed Message Digests . . 9 77 4. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 10 78 4.1. Successful Bearer Token Exchange . . . . . . . . . . . . 11 79 4.2. Failed Exchange . . . . . . . . . . . . . . . . . . . . . 11 80 4.3. SMTP Example of a Failed Negotiation . . . . . . . . . . 12 81 5. Security Considerations . . . . . . . . . . . . . . . . . . . 13 82 6. Internationalization Considerations . . . . . . . . . . . . . 14 83 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 84 7.1. SASL Registration . . . . . . . . . . . . . . . . . . . . 14 85 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 86 8.1. Normative References . . . . . . . . . . . . . . . . . . 15 87 8.2. Informative References . . . . . . . . . . . . . . . . . 16 88 Appendix A. Acknowlegements . . . . . . . . . . . . . . . . . . 16 89 Appendix B. Document History . . . . . . . . . . . . . . . . . . 16 90 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19 92 1. Introduction 94 OAuth 1.0a [RFC5849] and OAuth 2.0 [RFC6749] are protocol frameworks 95 that enable a third-party application to obtain limited access to a 96 protected resource, either on behalf of a resource owner by 97 orchestrating an approval interaction, or by allowing the third-party 98 application to obtain access on its own behalf. 100 The core OAuth 2.0 specification [RFC6749] specifies the interaction 101 between the OAuth client and the authorization server; it does not 102 define the interaction between the OAuth client and the resource 103 server for the access to a protected resource using an Access Token. 104 Instead, the OAuth client to resource server interaction is described 105 in separate specifications, such as the bearer token specification 106 [RFC6750] and the MAC Token specification 107 [I-D.ietf-oauth-v2-http-mac]. OAuth 1.0a included the protocol 108 specification for the communication between the OAuth client and the 109 resource server in [RFC5849]. 111 The main use cases for OAuth 2.0 and OAuth 1.0a have so far focused 112 on an HTTP-based environment only. This document integrates OAuth 113 1.0a and OAuth 2.0 into non-HTTP-based applications using the 114 integration into SASL. Hence, this document takes advantage of the 115 OAuth protocol and its deployment base to provide a way to use the 116 Simple Authentication and Security Layer (SASL) [RFC4422] to gain 117 access to resources when using non-HTTP-based protocols, such as the 118 Internet Message Access Protocol (IMAP) [RFC3501] and SMTP [RFC5321], 119 which is what this memo uses in the examples. 121 To illustrate the impact of integrating this specification into an 122 OAuth-enabled application environment Figure 1 shows the abstract 123 message flow of OAuth 2.0 [RFC6749]. As indicated in the figure, 124 this document impacts the exchange of messages (E) and (F) since SASL 125 is used for interaction between the client and the resource server 126 instead of HTTP. 128 ----+ 129 +--------+ +---------------+ | 130 | |--(A)-- Authorization Request --->| Resource | | 131 | | | Owner | |Plain 132 | |<-(B)------ Access Grant ---------| | |OAuth 133 | | +---------------+ |2.0 134 | | | 135 | | Client Credentials & +---------------+ | 136 | |--(C)------ Access Grant -------->| Authorization | | 137 | Client | | Server | | 138 | |<-(D)------ Access Token ---------| | | 139 | | (w/ Optional Refresh Token) +---------------+ | 140 | | ----+ 141 | | ----+ 142 | | +---------------+ | 143 | | | | |OAuth 144 | |--(E)------ Access Token -------->| Resource | |over 145 | | | Server | |SASL 146 | |<-(F)---- Protected Resource -----| | | 147 | | | | | 148 +--------+ +---------------+ | 149 ----+ 151 Figure 1: OAuth 2.0 Protocol Flow 153 The Simple Authentication and Security Layer (SASL) is a framework 154 for providing authentication and data security services in 155 connection-oriented protocols via replaceable authentication 156 mechanisms. It provides a structured interface between protocols and 157 mechanisms. The resulting framework allows new protocols to reuse 158 existing authentication protocols and allows old protocols to make 159 use of new authentication mechanisms. The framework also provides a 160 protocol for securing subsequent protocol exchanges within a data 161 security layer. 163 When OAuth is integrated into SASL the high-level steps are as 164 follows: 166 (A) The client requests authorization from the resource owner. 167 The authorization request can be made directly to the resource 168 owner (as shown), or preferably indirectly via the authorization 169 server as an intermediary. 171 (B) The client receives an authorization grant which is a 172 credential representing the resource owner's authorization, 173 expressed using one of four grant types defined in this 174 specification or using an extension grant type. The authorization 175 grant type depends on the method used by the client to request 176 authorization and the types supported by the authorization server. 178 (C) The client requests an access token by authenticating with the 179 authorization server and presenting the authorization grant. 181 (D) The authorization server authenticates the client and 182 validates the authorization grant, and if valid issues an access 183 token. 185 (E) The client requests the protected resource from the resource 186 server and authenticates by presenting the access token. 188 (F) The resource server validates the access token, and if valid, 189 indicates a successful authentication. 191 Again, steps (E) and (F) are not defined in [RFC6749] (but are 192 described in, for example, [RFC6750] for the OAuth Bearer Token 193 instead) and are the main functionality specified within this 194 document. Consequently, the message exchange shown in Figure 1 is 195 the result of this specification. The client will generally need to 196 determine the authentication endpoints (and perhaps the service 197 endpoints) before the OAuth 2.0 protocol exchange messages in steps 198 (A)-(D) are executed. The discovery of the resource owner and 199 authorization server endpoints is outside the scope of this 200 specification. The client must discover those endpoints using a 201 discovery mechanisms, such as Webfinger using host-meta [RFC7033]. 202 In band discovery is not tenable if clients support the OAuth 2.0 203 password grant. Once credentials are obtained the client proceeds to 204 steps (E) and (F) defined in this specification. 206 OAuth 1.0 follows a similar model but uses a different terminology 207 and does not separate the resource server from the authorization 208 server. 210 2. Terminology 212 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 213 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 214 document are to be interpreted as described in [RFC2119]. 216 The reader is assumed to be familiar with the terms used in the OAuth 217 2.0 specification [RFC6749]. 219 In examples, "C:" and "S:" indicate lines sent by the client and 220 server respectively. Line breaks have been inserted for readability. 222 Note that the IMAP SASL specification requires base64 encoding, see 223 Section 4 of [RFC4648], not this memo. 225 3. OAuth SASL Mechanism Specifications 227 SASL is used as an authentication framework in a variety of 228 application layer protocols. This document defines the following 229 SASL mechanisms for usage with OAuth: 231 OAUTHBEARER: OAuth 2.0 bearer tokens, as described in [RFC6750]. 232 RFC 6750 uses Transport Layer Security (TLS) to secure the 233 protocol interaction between the client and the resource 234 server. 236 OAUTH10A: OAuth 1.0a MAC tokens (using the HMAC-SHA1 keyed 237 message digest), as described in Section 3.4.2 of [RFC5849]. 239 New extensions may be defined to add additional OAuth Access Token 240 Types. Such a new SASL OAuth mechanism can be added by simply 241 registering the new name(s) and citing this specification for the 242 further definition. 244 These mechanisms are client initiated and lock-step, the server 245 always replying to a client message. In the case where the client 246 has and correctly uses a valid token the flow is: 248 o Client sends a valid and correct initial client response. 250 o Server responds with a successful authentication. 252 In the case where authorization fails the server sends an error 253 result, then client MUST then send an additional message to the 254 server in order to allow the server to finish the exchange. Some 255 protocols and common SASL implementations do not support both sending 256 a SASL message and finalizing a SASL negotiation, the additional 257 client message in the error case deals with this problem. This 258 exchange is: 260 o Client sends an invalid initial client response. 262 o Server responds with an error message. 264 o Client sends a dummy client response. 266 o Server fails the authentication. 268 3.1. Initial Client Response 270 Client responses are a key/value pair sequence. These key/value 271 pairs carry the equivalent values from an HTTP context in order to be 272 able to complete an OAuth style HTTP authorization. Unknown key/ 273 value pairs MUST be ignored by the server. The ABNF [RFC5234] syntax 274 is: 276 kvsep = %x01 277 key = 1*ALPHA 278 value = *(VCHAR / SP / HTAB / CR / LF ) 279 kvpair = key "=" value kvsep 280 client_resp = 0*kvpair kvsep 282 The following key/value pairs are defined in the client response: 284 auth (REQUIRED): The payload of the HTTP Authorization header for 285 an equivalent HTTP OAuth authorization. 287 host: Contains the host name to which the client connected. 289 port: Contains the port number represented as a decimal positive 290 integer string without leading zeros to which the client 291 connected. 293 qs: The HTTP query string. This is reserved for future use, the 294 client SHOUD NOT send it, and has the default value of "". 296 For OAuth token types that use keyed message digests the client MUST 297 send host and port number key/values, and the server MUST fail an 298 authorization request requiring keyed message digests that do not 299 have host and port values. In OAuth 1.0a for example, the so-called 300 "signature base string calculation" includes the reconstructed HTTP 301 URL. 303 3.1.1. Reserved Key/Values 304 In these mechanisms values for path, query string and post body are 305 assigned default values. OAuth authorization schemes MAY define 306 usage of these in the SASL context and extend this specification. 307 For OAuth Access Token Types that use request keyed message digest 308 the default values MUST be used unless explicit values are provided 309 in the client response. The following key values are reserved for 310 future use: 312 mthd (RESERVED): HTTP method, the default value is "POST". 314 path (RESERVED): HTTP path data, the default value is "/". 316 post (RESERVED): HTTP post data, the default value is "". 318 3.2. Server's Response 320 The server validates the response per the specification for the OAuth 321 Access Token Types used. If the OAuth Access Token Type utilizes a 322 keyed message digest of the request parameters then the client must 323 provide a client response that satisfies the data requirements for 324 the scheme in use. 326 The server responds to a successfully verified client message by 327 completing the SASL negotiation. The authenticated identity reported 328 by the SASL mechanism is the identity securely established for the 329 client with the OAuth credential. The application, not the SASL 330 mechanism, based on local access policy determines whether the 331 identity reported by the mechanism is allowed access to the requested 332 resource. Note that the semantics of the authz-id is specified by 333 the SASL framework [RFC4422]. 335 3.2.1. OAuth Identifiers in the SASL Context 337 In the OAuth framework the client may be authenticated by the 338 authorization server and the resource owner is authenticated to the 339 authorization server. OAuth access tokens may contain information 340 about the authentication of the resource owner and about the client 341 and may therefore make this information accessible to the resource 342 server. 344 If both identifiers are needed by an application the developer will 345 need to provide a way to communicate that from the SASL mechanism 346 back to the application. 348 3.2.2. Server Response to Failed Authentication 349 For a failed authentication the server returns a JSON [RFC4627] 350 formatted error result, and fails the authentication. The error 351 result consists of the following values: 353 status (REQUIRED): The authorization error code. Valid error 354 codes are defined in the IANA [[need registry name]] registry 355 specified in the OAuth 2 core specification. 357 scope (OPTIONAL): An OAuth scope which is valid to access the 358 service. This may be empty which implies that unscoped tokens 359 are required, or a space separated list. Use of a space 360 separated list is NOT RECOMMENDED. 362 If the resource server provides a scope then the client MUST always 363 request scoped tokens from the token endpoint. If the resource 364 server provides no scope to the client then the client SHOULD presume 365 an empty scope (unscoped token) is needed. 367 If channel binding is in use and the channel binding fails the server 368 responds with a status code set to 412 to indicate that the channel 369 binding precondition failed. If the authentication scheme in use 370 does not include signing the server SHOULD revoke the presented 371 credential and the client SHOULD discard that credential. 373 3.2.3. Completing an Error Message Sequence 375 Section 3.6 of [RFC4422] explicitly prohibits additional information 376 in an unsuccessful authentication outcome. Therefore, the error 377 message is sent in a normal message. The client MUST then send an 378 additional client response consisting of a single %x01 (control A) 379 character to the server in order to allow the server to finish the 380 exchange. 382 3.3. OAuth Access Token Types using Keyed Message Digests 384 OAuth Access Token Types may use keyed message digests and the client 385 and the resource server may need to perform a cryptographic 386 computation for integrity protection and data origin authentication. 388 OAuth is designed for access to resources identified by URIs. SASL 389 is designed for user authentication, and has no facility for more 390 fine-grained access control. In this specification we require or 391 define default values for the data elements from an HTTP request 392 which allow the signature base string to be constructed properly. 393 The default HTTP path is "/" and the default post body is empty. 394 These atoms are defined as extension points so that no changes are 395 needed if there is a revision of SASL which supports more specific 396 resource authorization, e.g., IMAP access to a specific folder or FTP 397 access limited to a specific directory. 399 Using the example in the OAuth 1.0a specification as a starting 400 point, on an IMAP server running on port 143 and given the OAuth 1.0a 401 style authorization request (with %x01 shown as ^A and line breaks 402 added for readability) below: 404 n,a=user@example.com^A 405 host=example.com^A 406 user=user@example.com^A 407 port=143^A 408 auth=OAuth realm="Example", 409 oauth_consumer_key="9djdj82h48djs9d2", 410 oauth_token="kkk9d7dh3k39sjv7", 411 oauth_signature_method="HMAC-SHA1", 412 oauth_timestamp="137131201", 413 oauth_nonce="7d8f3e4a", 414 oauth_signature="Tm90IGEgcmVhbCBzaWduYXR1cmU%3D"^A^A 416 The signature base string would be constructed per the OAuth 1.0 417 specification [RFC5849] with the following things noted: 419 o The method value is defaulted to POST. 421 o The scheme defaults to be "http", and any port number other than 422 80 is included. 424 o The path defaults to "/". 426 o The query string defaults to "". 428 In this example the signature base string with line breaks added for 429 readability would be: 431 POST&http%3A%2F%2Fexample.com:143%2F&oauth_consumer_key%3D9djdj82h4 432 8djs9d2%26oauth_nonce%3D7d8f3e4a%26oauth_signature_method%3DHMAC-SH 433 A1%26oauth_timestamp%3D137131201%26oauth_token%3Dkkk9d7dh3k39sjv7 435 4. Examples 437 These examples illustrate exchanges between an IMAP and SMTP clients 438 and servers. 440 Note to implementers: The SASL OAuth method names are case 441 insensitive. One example uses "Bearer" but that could as easily be 442 "bearer", "BEARER", or "BeArEr". 444 4.1. Successful Bearer Token Exchange 446 This example shows a successful OAuth 2.0 bearer token exchange. 447 Note that line breaks are inserted for readability and the underlying 448 TLS establishment is not shown either. 450 S: * OK IMAP4rev1 Server Ready 451 C: t0 CAPABILITY 452 S: * CAPABILITY IMAP4rev1 AUTH=OAUTHBEARER SASL-IR 453 S: t0 OK Completed 454 C: t1 AUTHENTICATE OAUTHBEARER bixhPXVzZXJAZXhhbXBsZS5jb20BaG9zdD1zZX 455 J2ZXIuZXhhbXBsZS5jb20BcG9ydD0xNDMBYXV0aD1CZWFyZXIgdkY5ZGZ0NHFtV 456 GMyTnZiM1JsY2tCaGJIUmhkbWx6ZEdFdVkyOXRDZz09AQE= 457 S: t1 OK SASL authentication succeeded 459 As required by IMAP [RFC3501], the payloads are base64-encoded. The 460 decoded initial client response (with %x01 represented as ^A and long 461 lines wrapped for readability) is: 463 n,a=user@example.com^Ahost=server.example.com^Aport=143^A 464 auth=Bearer vF9dft4qmTc2Nvb3RlckBhbHRhdmlzdGEuY29tCg==^A^A 466 The same credential used in an SMTP exchange is shown below. Note 467 that line breaks are inserted for readability, and that the SMTP 468 protocol terminates lines with CR and LF characters (ASCII values 469 0x0D and 0x0A), these are not displayed explicitly in the example. 471 [connection begins] 472 S: 220 mx.example.com ESMTP 12sm2095603fks.9 473 C: EHLO sender.example.com 474 S: 250-mx.example.com at your service,[172.31.135.47] 475 S: 250-SIZE 35651584 476 S: 250-8BITMIME 477 S: 250-AUTH LOGIN PLAIN OAUTHBEARER 478 S: 250-ENHANCEDSTATUSCODES 479 S: 250 PIPELINING 480 C: t1 AUTHENTICATE OAUTHBEARER bixhPXVzZXJAZXhhbXBsZS5jb20BaG9zdD1zZX 481 J2ZXIuZXhhbXBsZS5jb20BcG9ydD0xNDMBYXV0aD1CZWFyZXIgdkY5ZGZ0NHFtV 482 GMyTnZiM1JsY2tCaGJIUmhkbWx6ZEdFdVkyOXRDZz09AQE= 483 S: 235 Authentication successful. 484 [connection continues...] 486 4.2. Failed Exchange 488 This example shows a failed exchange because of the empty 489 Authorization header, which is how a client can query for the needed 490 scope. Note that line breaks are inserted for readability. 492 S: * CAPABILITY IMAP4rev1 AUTH=OAUTHBEARER SASL-IR IMAP4rev1 Server 493 Ready 494 S: t0 OK Completed 495 C: t1 AUTHENTICATE OAUTHBEARER cD10bHMtdW5pcXVlLGE9dXNlckBleGFtcG 496 xlLmNvbQFob3N0PXNlcnZlci5leGFtcGxlLmNvbQFwb3J0PTE0MwFhdXRoP 497 QFjYmRhdGE9AQE= 498 S: + ewoic3RhdHVzIjoiNDAxIgoic2NvcGUiOiJleGFtcGxlX3Njb3BlIgp9 499 C: + AQ== 500 S: t1 NO SASL authentication failed 502 The decoded initial client response is: 504 n,a=user@example.com,^Ahost=server.example.com^A 505 port=143^Aauth=^A^A 507 The decoded server error response is: 509 { 510 "status":"401", 511 "scope":"example_scope" 512 } 514 The client responds with the required dummy response. 516 4.3. SMTP Example of a Failed Negotiation 518 This example shows an authorization failure in an SMTP exchange. 519 Note that line breaks are inserted for readability, and that the SMTP 520 protocol terminates lines with CR and LF characters (ASCII values 521 0x0D and 0x0A), these are not displayed explicitly in the example. 523 [connection begins] 524 S: 220 mx.example.com ESMTP 12sm2095603fks.9 525 C: EHLO sender.example.com 526 S: 250-mx.example.com at your service,[172.31.135.47] 527 S: 250-SIZE 35651584 528 S: 250-8BITMIME 529 S: 250-AUTH LOGIN PLAIN OAUTHBEARER 530 S: 250-ENHANCEDSTATUSCODES 531 S: 250 PIPELINING 532 C: AUTH OAUTHBEARER bixhPT1zb21ldXNlckBleGFtcGxlLmNvbQFhdXRoPUJlYXJlciB2 533 RjlkZnQ0cW1UYzJOdmIzUmxja0JoZEhSaGRtbHpkR0V1WTI5dENnPT0BAQ== 534 S: 334 eyJzdGF0dXMiOiI0MDEiLCJzY2hlbWVzIjoiYmVhcmVyIG1hYyIsInNjb3BlIjoia 535 HR0cHM6Ly9tYWlsLmdvb2dsZS5jb20vIn0K 536 C: AQ== 537 S: 535-5.7.1 Username and Password not accepted. Learn more at 538 S: 535 5.7.1 http://support.example.com/mail/oauth 539 [connection continues...] 540 The server returned an error message in the 334 SASL message, the 541 client responds with the required dummy response, and the server 542 finalizes the negotiation. 544 5. Security Considerations 546 OAuth 1.0a and OAuth 2 allows for a variety of deployment scenarios, 547 and the security properties of these profiles vary. As shown in 548 Figure 1 this specification is aimed to be integrated into a larger 549 OAuth deployment. Application developers therefore need to 550 understand the needs of their security requirements based on a threat 551 assessment before selecting a specific SASL OAuth mechanism. For 552 OAuth 2.0 a detailed security document [RFC6819] provides guidance to 553 select those OAuth 2.0 components that help to mitigate threats for a 554 given deployment. For OAuth 1.0a Section 4 of RFC 5849 [RFC5849] 555 provides guidance specific to OAuth 1.0. 557 This document specifies three SASL Mechanisms for OAuth and each 558 comes with different security properties. 560 OAUTHBEARER: This mechanism borrows from OAuth 2.0 bearer tokens 561 [RFC6750]. It relies on the application using TLS to protect the 562 OAuth 2.0 Bearer Token exchange; without TLS usage at the 563 application layer this method is completely insecure. 564 Consequently, TLS MUST be provided by the application when 565 choosing this authentication mechanism. 567 OAUTH10A: This mechanism re-uses OAuth 1.0a MAC tokens (using the 568 HMAC-SHA1 keyed message digest), as described in Section 3.4.2 of 569 [RFC5849]. To compute the keyed message digest in the same way 570 was in RFC 5839 this specification conveys additional parameters 571 between the client and the server. This SASL mechanism only 572 supports client authentication. If server-side authentication is 573 desireable then it must be provided by the application underneath 574 the SASL layer. The use of TLS is strongly RECOMMENDED. 576 Additionally, the following aspects are worth pointing out: 578 An access token is not equivalent to the user's long term password. 580 Care has to be taken when these OAuth credentials are used for 581 actions like changing passwords (as it is possible with some 582 protocols, e.g., XMPP). The resource server should ensure that 583 actions taken in the authenticated channel are appropriate to the 584 strength of the presented credential. 586 Lifetime of the appliation sessions. 588 It is possible that SASL will be authenticating a connection and 589 the life of that connection may outlast the life of the access 590 token used to establish it. This is a common problem in 591 application protocols where connections are long-lived, and not a 592 problem with this mechanism per se. Resource servers may 593 unilaterally disconnect clients in accordance with the application 594 protocol. 596 Access tokens have a lifetime. 598 Reducing the lifetime of an access token provides security 599 benefits and OAuth 2.0 introduces refresh tokens to obtain new 600 access token on the fly without any need for a human interaction. 601 Additionally, a previously obtained access token may be revoked or 602 rendered invalid at any time by the authorization server. The 603 client may request a new access token for each connection to a 604 resource server, but it should cache and re-use valid credentials. 606 6. Internationalization Considerations 608 The identifer asserted by the OAuth authorization server about the 609 resource owner inside the access token may be displayed to a human. 610 For example, when SASL is used in the context of IMAP the resource 611 server may assert the resource owner's email address to the IMAP 612 server for usage in an email-based application. The identifier may 613 therefore contain internationalized characters and an application 614 needs to ensure that the mapping between the identifier provided by 615 OAuth is suitable for use with the application layer protocol SASL is 616 incorporated into. 618 At the time of writing the standardization of the various claims in 619 the access token (in JSON format) is still ongoing, see 620 [I-D.ietf-oauth-json-web-token]. Once completed it will provide a 621 standardized format for exchanging identity information between the 622 authorization server and the resource server. 624 7. IANA Considerations 626 7.1. SASL Registration 628 The IANA is requested to register the following SASL profile: 630 SASL mechanism profile: OAUTHBEARER 632 Security Considerations: See this document 634 Published Specification: See this document 635 For further information: Contact the authors of this document. 637 Owner/Change controller: the IETF 639 Note: None 641 The IANA is requested to register the following SASL profile: 643 SASL mechanism profile: OAUTH10A 645 Security Considerations: See this document 647 Published Specification: See this document 649 For further information: Contact the authors of this document. 651 Owner/Change controller: the IETF 653 Note: None 655 8. References 657 8.1. Normative References 659 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 660 Requirement Levels", BCP 14, RFC 2119, March 1997. 662 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 663 (SHA1)", RFC 3174, September 2001. 665 [RFC4422] Melnikov, A. and K. Zeilenga, "Simple Authentication and 666 Security Layer (SASL)", RFC 4422, June 2006. 668 [RFC4627] Crockford, D., "The application/json Media Type for 669 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 671 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 672 Encodings", RFC 4648, October 2006. 674 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 675 Channels", RFC 5056, November 2007. 677 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 678 Specifications: ABNF", STD 68, RFC 5234, January 2008. 680 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 681 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 683 [RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, 684 April 2010. 686 [RFC6749] Hardt, D., "The OAuth 2.0 Authorization Framework", RFC 687 6749, October 2012. 689 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 690 Framework: Bearer Token Usage", RFC 6750, October 2012. 692 8.2. Informative References 694 [I-D.ietf-oauth-json-web-token] 695 Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 696 (JWT)", draft-ietf-oauth-json-web-token-13 (work in 697 progress), November 2013. 699 [I-D.ietf-oauth-v2-http-mac] 700 Richer, J., Mills, W., Tschofenig, H., and P. Hunt, "OAuth 701 2.0 Message Authentication Code (MAC) Tokens", draft-ietf- 702 oauth-v2-http-mac-04 (work in progress), July 2013. 704 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 705 4rev1", RFC 3501, March 2003. 707 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 708 October 2008. 710 [RFC6819] Lodderstedt, T., McGloin, M., and P. Hunt, "OAuth 2.0 711 Threat Model and Security Considerations", RFC 6819, 712 January 2013. 714 [RFC7033] Jones, P., Salgueiro, G., Jones, M., and J. Smarr, 715 "WebFinger", RFC 7033, September 2013. 717 Appendix A. Acknowlegements 719 The authors would like to thank the members of the Kitten working 720 group, and in addition and specifically: Simon Josefson, Torsten 721 Lodderstadt, Ryan Troll, Alexey Melnikov, Jeffrey Hutzelman, and Nico 722 Williams. 724 This document was produced under the chairmanship of Alexey Melnikov, 725 Tom Yu, Shawn Emery, Josh Howlett, Sam Hartman. The supervising area 726 directors was Stephen Farrell. 728 Appendix B. Document History 730 [[ to be removed by RFC editor before publication as an RFC ]] 731 -12 733 o Removed -PLUS components from the specification. 735 -11 737 o Removed GSS-API components from the specification. 739 o Updated security consideration section. 741 -10 743 o Clarifications throughout the document in response to the feedback 744 from Jeffrey Hutzelman. 746 -09 748 o Incorporated review by Alexey and Hannes. 750 o Clarified the three OAuth SASL mechanisms. 752 o Updated references 754 o Extended acknowledgements 756 -08 758 o Fixed the channel binding examples for p=$cbtype 760 o More tuning of the authcid language and edited and renamed 3.2.1. 762 -07 764 o Struck the MUST langiage from authzid. 766 o 768 -06 770 o Removed the user field. Fixed the examples again. 772 o Added canonicalization language. 774 o 776 -05 778 o Fixed the GS2 header language again. 780 o Separated out different OAuth schemes into different SASL 781 mechanisms. Took out the scheme in the error return. Tuned up 782 the IANA registrations. 784 o Added the user field back into the SASL message. 786 o Fixed the examples (again). 788 o 790 -04 792 o Changed user field to be carried in the gs2-header, and made gs2 793 header explicit in all cases. 795 o Converted MAC examples to OAuth 1.0a. Moved MAC to an informative 796 reference. 798 o Changed to sending an empty client response (single control-A) as 799 the second message of a failed sequence. 801 o Fixed channel binding prose to refer to the normative specs and 802 removed the hashing of large channel binding data, which brought 803 mroe problems than it solved. 805 o Added a SMTP examples for Bearer use case. 807 -03 809 o Added user field into examples and fixed egregious errors there as 810 well. 812 o Added text reminding developers that Authorization scheme names 813 are case insensitive. 815 -02 817 o Added the user data element back in. 819 o Minor editorial changes. 821 -01 823 o Ripping out discovery. Changed to refer to I-D.jones-appsawg- 824 webfinger instead of WF and SWD older drafts. 826 o Replacing HTTP as the message format and adjusted all examples. 828 -00 830 o Renamed draft into proper IETF naming format now that it's 831 adopted. 833 o Minor fixes. 835 Authors' Addresses 837 William Mills 838 Yahoo! Inc. 840 Email: wmills_92105@yahoo.com 842 Tim Showalter 844 Email: tjs@psaux.com 846 Hannes Tschofenig 847 Nokia Solutions and Networks 848 Linnoitustie 6 849 Espoo 02600 850 Finland 852 Phone: +358 (50) 4871445 853 Email: Hannes.Tschofenig@gmx.net 854 URI: http://www.tschofenig.priv.at