idnits 2.17.1 draft-ietf-kitten-sasl-oauth-14.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 3 instances of too long lines in the document, the longest one being 4 characters in excess of 72. 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 (March 6, 2014) is 3702 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 670, but no explicit reference was found in the text == Unused Reference: 'RFC5246' is defined on line 685, 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-18 -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) Summary: 5 errors (**), 0 flaws (~~), 5 warnings (==), 3 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: September 7, 2014 6 H. Tschofenig 7 ARM Ltd. 8 March 6, 2014 10 A set of SASL Mechanisms for OAuth 11 draft-ietf-kitten-sasl-oauth-14.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 September 7, 2014. 50 Copyright Notice 52 Copyright (c) 2014 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 . . . . . . . . . . . . . . . . . . . . . . . . 3 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 . . . . . . . . . . . . . . . . . 8 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 . . . . . . 9 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 . . . . . . . . . . . . . . . . . . 17 89 Appendix B. Document History . . . . . . . . . . . . . . . . . . 17 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 [RFC2616] environment only. This document 113 integrates OAuth 1.0a and OAuth 2.0 into non-HTTP-based applications 114 using the integration into SASL. Hence, this document takes 115 advantage of the OAuth protocol and its deployment base to provide a 116 way to use the Simple Authentication and Security Layer (SASL) 117 [RFC4422] to gain access to resources when using non-HTTP-based 118 protocols, such as the Internet Message Access Protocol (IMAP) 119 [RFC3501] and the Simple Mail Transfer Protocol (SMTP) [RFC5321], 120 which is what this memo uses in the examples. 122 To illustrate the impact of integrating this specification into an 123 OAuth-enabled application environment Figure 1 shows the abstract 124 message flow of OAuth 2.0 [RFC6749]. As indicated in the figure, 125 this document impacts the exchange of messages (E) and (F) since SASL 126 is used for interaction between the client and the resource server 127 instead of HTTP. 129 ----+ 130 +--------+ +---------------+ | 131 | |--(A)-- Authorization Request --->| Resource | | 132 | | | Owner | |Plain 133 | |<-(B)------ Access Grant ---------| | |OAuth 134 | | +---------------+ |2.0 135 | | | 136 | | Client Credentials & +---------------+ | 137 | |--(C)------ Access Grant -------->| Authorization | | 138 | Client | | Server | | 139 | |<-(D)------ Access Token ---------| | | 140 | | (w/ Optional Refresh Token) +---------------+ | 141 | | ----+ 142 | | ----+ 143 | | +---------------+ | 144 | | | | |OAuth 145 | |--(E)------ Access Token -------->| Resource | |over 146 | | | Server | |SASL 147 | |<-(F)---- Protected Resource -----| | | 148 | | | | | 149 +--------+ +---------------+ | 150 ----+ 152 Figure 1: OAuth 2.0 Protocol Flow 154 The Simple Authentication and Security Layer (SASL) is a framework 155 for providing authentication and data security services in 156 connection-oriented protocols via replaceable authentication 157 mechanisms. It provides a structured interface between protocols and 158 mechanisms. The resulting framework allows new protocols to reuse 159 existing authentication protocols and allows old protocols to make 160 use of new authentication mechanisms. The framework also provides a 161 protocol for securing subsequent protocol exchanges within a data 162 security layer. 164 When OAuth is integrated into SASL the high-level steps are as 165 follows: 167 (A) The client requests authorization from the resource owner. 168 The authorization request can be made directly to the resource 169 owner (as shown), or preferably indirectly via the authorization 170 server as an intermediary. 172 (B) The client receives an authorization grant which is a 173 credential representing the resource owner's authorization, 174 expressed using one of four grant types defined in this 175 specification or using an extension grant type. The authorization 176 grant type depends on the method used by the client to request 177 authorization and the types supported by the authorization server. 179 (C) The client requests an access token by authenticating with the 180 authorization server and presenting the authorization grant. 182 (D) The authorization server authenticates the client and 183 validates the authorization grant, and if valid issues an access 184 token. 186 (E) The client requests the protected resource from the resource 187 server and authenticates by presenting the access token. 189 (F) The resource server validates the access token, and if valid, 190 indicates a successful authentication. 192 Again, steps (E) and (F) are not defined in [RFC6749] (but are 193 described in, for example, [RFC6750] for the OAuth Bearer Token 194 instead) and are the main functionality specified within this 195 document. Consequently, the message exchange shown in Figure 1 is 196 the result of this specification. The client will generally need to 197 determine the authentication endpoints (and perhaps the service 198 endpoints) before the OAuth 2.0 protocol exchange messages in steps 199 (A)-(D) are executed. The discovery of the resource owner and 200 authorization server endpoints is outside the scope of this 201 specification. The client must discover those endpoints using a 202 discovery mechanisms, such as Webfinger using host-meta [RFC7033]. 203 In band discovery is not tenable if clients support the OAuth 2.0 204 password grant. Once credentials are obtained the client proceeds to 205 steps (E) and (F) defined in this specification. 207 OAuth 1.0 follows a similar model but uses a different terminology 208 and does not separate the resource server from the authorization 209 server. 211 2. Terminology 213 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 214 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 215 document are to be interpreted as described in [RFC2119]. 217 The reader is assumed to be familiar with the terms used in the OAuth 218 2.0 specification [RFC6749] and SASL [RFC4422]. 220 In examples, "C:" and "S:" indicate lines sent by the client and 221 server respectively. Line breaks have been inserted for readability. 223 Note that the IMAP SASL specification requires base64 encoding, see 224 Section 4 of [RFC4648], not this memo. 226 3. OAuth SASL Mechanism Specifications 228 SASL is used as an authentication framework in a variety of 229 application layer protocols. This document defines the following 230 SASL mechanisms for usage with OAuth: 232 OAUTHBEARER: OAuth 2.0 bearer tokens, as described in [RFC6750]. 233 RFC 6750 uses Transport Layer Security (TLS) to secure the 234 protocol interaction between the client and the resource 235 server. 237 OAUTH10A: OAuth 1.0a MAC tokens (using the HMAC-SHA1 keyed 238 message digest), as described in Section 3.4.2 of [RFC5849]. 240 New extensions may be defined to add additional OAuth Access Token 241 Types. Such a new SASL OAuth mechanism can be added by simply 242 registering the new name(s) and citing this specification for the 243 further definition. 245 These mechanisms are client initiated and lock-step, the server 246 always replying to a client message. In the case where the client 247 has and correctly uses a valid token the flow is: 249 1. Client sends a valid and correct initial client response. 251 2. Server responds with a successful authentication. 253 In the case where authorization fails the server sends an error 254 result, then client MUST then send an additional message to the 255 server in order to allow the server to finish the exchange. Some 256 protocols and common SASL implementations do not support both sending 257 a SASL message and finalizing a SASL negotiation, the additional 258 client message in the error case deals with this problem. This 259 exchange is: 261 1. Client sends an invalid initial client response. 263 2. Server responds with an error message. 265 3. Client sends a dummy client response. 267 4. Server fails the authentication. 269 3.1. Initial Client Response 271 Client responses are a key/value pair sequence. The initial client 272 response includes a gs2-header as defined in GS2 [RFC5801] which is 273 defined here as a stub for compatibility with GS2 if a GS2 mechanism 274 is formally defined, but this document does not define one. These 275 key/value pairs carry the equivalent values from an HTTP context in 276 order to be able to complete an OAuth style HTTP authorization. 277 Unknown key/value pairs MUST be ignored by the server. The ABNF 278 [RFC5234] syntax is: 280 kvsep = %x01 281 key = 1*(ALPHA / ",") 282 value = *(VCHAR / SP / HTAB / CR / LF ) 283 kvpair = key "=" value kvsep 284 gs2-header = ALPHA "," value 285 client_resp = gs2-header kvsep 0*kvpair kvsep 287 The GS2 289 The following key/value pairs are defined in the client response: 291 auth (REQUIRED): The payload of the HTTP Authorization header for 292 an equivalent HTTP OAuth authorization. 294 user (REQUIRED): Contains the user name being authenticated. The 295 server MAY use this as a routing or database lookup hint. The 296 server MUST NOT use this as authoritative, the user name MUST 297 be asserted by the OAuth credential. 299 host: Contains the host name to which the client connected. 301 port: Contains the port number represented as a decimal positive 302 integer string without leading zeros to which the client 303 connected. 305 qs: The HTTP query string. This is reserved for future use, the 306 client SHOUD NOT send it, and has the default value of "". 308 For OAuth token types that use keyed message digests the client MUST 309 send host and port number key/values, and the server MUST fail an 310 authorization request requiring keyed message digests that do not 311 have host and port values. In OAuth 1.0a for example, the so-called 312 "signature base string calculation" includes the reconstructed HTTP 313 URL. 315 3.1.1. Reserved Key/Values 317 In these mechanisms values for path, query string and post body are 318 assigned default values. OAuth authorization schemes MAY define 319 usage of these in the SASL context and extend this specification. 320 For OAuth Access Token Types that use request keyed message digest 321 the default values MUST be used unless explicit values are provided 322 in the client response. The following key values are reserved for 323 future use: 325 mthd (RESERVED): HTTP method, the default value is "POST". 327 path (RESERVED): HTTP path data, the default value is "/". 329 post (RESERVED): HTTP post data, the default value is "". 331 3.2. Server's Response 333 The server validates the response per the specification for the OAuth 334 Access Token Types used. If the OAuth Access Token Type utilizes a 335 keyed message digest of the request parameters then the client must 336 provide a client response that satisfies the data requirements for 337 the scheme in use. 339 The server responds to a successfully verified client message by 340 completing the SASL negotiation. The authenticated identity reported 341 by the SASL mechanism is the identity securely established for the 342 client with the OAuth credential. The application, not the SASL 343 mechanism, based on local access policy determines whether the 344 identity reported by the mechanism is allowed access to the requested 345 resource. Note that the semantics of the authz-id is specified by 346 the SASL framework [RFC4422]. 348 3.2.1. OAuth Identifiers in the SASL Context 350 In the OAuth framework the client may be authenticated by the 351 authorization server and the resource owner is authenticated to the 352 authorization server. OAuth access tokens may contain information 353 about the authentication of the resource owner and about the client 354 and may therefore make this information accessible to the resource 355 server. 357 If both identifiers are needed by an application the developer will 358 need to provide a way to communicate that from the SASL mechanism 359 back to the application. 361 3.2.2. Server Response to Failed Authentication 363 For a failed authentication the server returns a JSON [RFC4627] 364 formatted error result, and fails the authentication. The error 365 result consists of the following values: 367 status (REQUIRED): The authorization error code. Valid error 368 codes are defined in the IANA "OAuth Extensions Error Registry" 369 specified in the OAuth 2 core specification. 371 scope (OPTIONAL): An OAuth scope which is valid to access the 372 service. This may be empty which implies that unscoped tokens 373 are required, or a scope value. If a scope is specified then a 374 single scope is preferred, use of a space separated list of 375 scopes is NOT RECOMMENDED. 377 If the resource server provides a scope then the client MUST always 378 request scoped tokens from the token endpoint. If the resource 379 server provides no scope to the client then the client SHOULD presume 380 an empty scope (unscoped token) is needed. 382 3.2.3. Completing an Error Message Sequence 384 Section 3.6 of [RFC4422] explicitly prohibits additional information 385 in an unsuccessful authentication outcome. Therefore, the error 386 message is sent in a normal message. The client MUST then send an 387 additional client response consisting of a single %x01 (control A) 388 character to the server in order to allow the server to finish the 389 exchange. 391 3.3. OAuth Access Token Types using Keyed Message Digests 393 OAuth Access Token Types may use keyed message digests and the client 394 and the resource server may need to perform a cryptographic 395 computation for integrity protection and data origin authentication. 397 OAuth is designed for access to resources identified by URIs. SASL 398 is designed for user authentication, and has no facility for more 399 fine-grained access control. In this specification we require or 400 define default values for the data elements from an HTTP request 401 which allow the signature base string to be constructed properly. 402 The default HTTP path is "/" and the default post body is empty. 403 These atoms are defined as extension points so that no changes are 404 needed if there is a revision of SASL which supports more specific 405 resource authorization, e.g., IMAP access to a specific folder or FTP 406 access limited to a specific directory. 408 Using the example in the OAuth 1.0a specification as a starting 409 point, on an IMAP server running on port 143 and given the OAuth 1.0a 410 style authorization request (with %x01 shown as ^A and line breaks 411 added for readability) below: 413 n,^A 414 host=example.com^A 415 user=user@example.com^A 416 port=143^A 417 auth=OAuth realm="Example", 418 oauth_consumer_key="9djdj82h48djs9d2", 419 oauth_token="kkk9d7dh3k39sjv7", 420 oauth_signature_method="HMAC-SHA1", 421 oauth_timestamp="137131201", 422 oauth_nonce="7d8f3e4a", 423 oauth_signature="Tm90IGEgcmVhbCBzaWduYXR1cmU%3D"^A^A 425 The signature base string would be constructed per the OAuth 1.0 426 specification [RFC5849] with the following things noted: 428 o The method value is defaulted to POST. 430 o The scheme defaults to be "http", and any port number other than 431 80 is included. 433 o The path defaults to "/". 435 o The query string defaults to "". 437 In this example the signature base string with line breaks added for 438 readability would be: 440 POST&http%3A%2F%2Fexample.com:143%2F&oauth_consumer_key%3D9djdj82h4 441 8djs9d2%26oauth_nonce%3D7d8f3e4a%26oauth_signature_method%3DHMAC-SH 442 A1%26oauth_timestamp%3D137131201%26oauth_token%3Dkkk9d7dh3k39sjv7 444 4. Examples 446 These examples illustrate exchanges between an IMAP and SMTP clients 447 and servers. 449 Note to implementers: The SASL OAuth method names are case 450 insensitive. One example uses "Bearer" but that could as easily be 451 "bearer", "BEARER", or "BeArEr". 453 4.1. Successful Bearer Token Exchange 455 This example shows a successful OAuth 2.0 bearer token exchange. 456 Note that line breaks are inserted for readability and the underlying 457 TLS establishment is not shown either. 459 S: * OK IMAP4rev1 Server Ready 460 C: t0 CAPABILITY 461 S: * CAPABILITY IMAP4rev1 AUTH=OAUTHBEARER SASL-IR 462 S: t0 OK Completed 463 C: t1 AUTHENTICATE OAUTHBEARER biwBdXNlcj11c2VyQGV4YW1wbGUuY29tAWhvc3Q9c2Vyd 464 mVyLmV4YW1wbGUuY29tAXBvcnQ9MTQzAWF1dGg9QmVhcmVyIHZGOWRmdDRxbVRjMk52YjN 465 SbGNrQmhiSFJoZG1semRHRXVZMjl0Q2c9PQEB 466 S: t1 OK SASL authentication succeeded 468 As required by IMAP [RFC3501], the payloads are base64-encoded. The 469 decoded initial client response (with %x01 represented as ^A and long 470 lines wrapped for readability) is: 472 n,^Auser=user@example.com^Ahost=server.example.com^Aport=143^A 473 auth=Bearer vF9dft4qmTc2Nvb3RlckBhbHRhdmlzdGEuY29tCg==^A^A 475 The same credential used in an SMTP exchange is shown below. Note 476 that line breaks are inserted for readability, and that the SMTP 477 protocol terminates lines with CR and LF characters (ASCII values 478 0x0D and 0x0A), these are not displayed explicitly in the example. 480 [connection begins] 481 S: 220 mx.example.com ESMTP 12sm2095603fks.9 482 C: EHLO sender.example.com 483 S: 250-mx.example.com at your service,[172.31.135.47] 484 S: 250-SIZE 35651584 485 S: 250-8BITMIME 486 S: 250-AUTH LOGIN PLAIN OAUTHBEARER 487 S: 250-ENHANCEDSTATUSCODES 488 S: 250 PIPELINING 489 C: t1 AUTHENTICATE OAUTHBEARER biwBdXNlcj11c2VyQGV4YW1wbGUuY29tAWhvc 490 3Q9c2VydmVyLmV4YW1wbGUuY29tAXBvcnQ9MTQzAWF1dGg9QmVhcmVyIHZGOWR 491 mdDRxbVRjMk52YjNSbGNrQmhiSFJoZG1semRHRXVZMjl0Q2c9PQEB 492 S: 235 Authentication successful. 493 [connection continues...] 495 4.2. Failed Exchange 497 This example shows a failed exchange because of the empty 498 Authorization header, which is how a client can query for the needed 499 scope. Note that line breaks are inserted for readability. 501 S: * CAPABILITY IMAP4rev1 AUTH=OAUTHBEARER SASL-IR IMAP4rev1 Server 502 Ready 503 S: t0 OK Completed 504 C: t1 AUTHENTICATE OAUTHBEARER biwBdXNlcj11c2VyQGV4YW1wbGUuY29tAWhvc3Q9c2Vyd 505 mVyLmV4YW1wbGUuY29tAXBvcnQ9MTQzAWF1dGg9AWNiZGF0YT0BAQ== 506 S: + ewoic3RhdHVzIjoiNDAxIgoic2NvcGUiOiJleGFtcGxlX3Njb3BlIgp9 507 C: + AQ== 508 S: t1 NO SASL authentication failed 510 The decoded initial client response is: 512 n,^Auser=user@example.com^Ahost=server.example.com^A 513 port=143^Aauth=^A^A 515 The decoded server error response is: 517 { 518 "status":"401", 519 "scope":"example_scope" 520 } 522 The client responds with the required dummy response. 524 4.3. SMTP Example of a Failed Negotiation 526 This example shows an authorization failure in an SMTP exchange. 527 Note that line breaks are inserted for readability, and that the SMTP 528 protocol terminates lines with CR and LF characters (ASCII values 529 0x0D and 0x0A), these are not displayed explicitly in the example. 531 [connection begins] 532 S: 220 mx.example.com ESMTP 12sm2095603fks.9 533 C: EHLO sender.example.com 534 S: 250-mx.example.com at your service,[172.31.135.47] 535 S: 250-SIZE 35651584 536 S: 250-8BITMIME 537 S: 250-AUTH LOGIN PLAIN OAUTHBEARER 538 S: 250-ENHANCEDSTATUSCODES 539 S: 250 PIPELINING 540 C: AUTH OAUTHBEARER biwBdXNlcj1zb21ldXNlckBleGFtcGxlLmNvbQFhdXRoPUJlYXJl 541 ciB2RjlkZnQ0cW1UYzJOdmIzUmxja0JoZEhSaGRtbHpkR0V1WTI5dENnPT0BAQ== 542 S: 334 eyJzdGF0dXMiOiI0MDEiLCJzY2hlbWVzIjoiYmVhcmVyIG1hYyIsInNjb3BlIjoia 543 HR0cHM6Ly9tYWlsLmdvb2dsZS5jb20vIn0K 544 C: AQ== 545 S: 535-5.7.1 Username and Password not accepted. Learn more at 546 S: 535 5.7.1 http://support.example.com/mail/oauth 547 [connection continues...] 548 The server returned an error message in the 334 SASL message, the 549 client responds with the required dummy response, and the server 550 finalizes the negotiation. 552 5. Security Considerations 554 OAuth 1.0a and OAuth 2 allows for a variety of deployment scenarios, 555 and the security properties of these profiles vary. As shown in 556 Figure 1 this specification is aimed to be integrated into a larger 557 OAuth deployment. Application developers therefore need to 558 understand the needs of their security requirements based on a threat 559 assessment before selecting a specific SASL OAuth mechanism. For 560 OAuth 2.0 a detailed security document [RFC6819] provides guidance to 561 select those OAuth 2.0 components that help to mitigate threats for a 562 given deployment. For OAuth 1.0a Section 4 of RFC 5849 [RFC5849] 563 provides guidance specific to OAuth 1.0. 565 This document specifies two SASL Mechanisms for OAuth and each comes 566 with different security properties. 568 OAUTHBEARER: This mechanism borrows from OAuth 2.0 bearer tokens 569 [RFC6750]. It relies on the application using TLS to protect the 570 OAuth 2.0 Bearer Token exchange; without TLS usage at the 571 application layer this method is completely insecure. 572 Consequently, TLS MUST be provided by the application when 573 choosing this authentication mechanism. 575 OAUTH10A: This mechanism re-uses OAuth 1.0a MAC tokens (using the 576 HMAC-SHA1 keyed message digest), as described in Section 3.4.2 of 577 [RFC5849]. To compute the keyed message digest in the same way 578 was in RFC 5839 this specification conveys additional parameters 579 between the client and the server. This SASL mechanism only 580 supports client authentication. If server-side authentication is 581 desireable then it must be provided by the application underneath 582 the SASL layer. The use of TLS is strongly RECOMMENDED. 584 Additionally, the following aspects are worth pointing out: 586 An access token is not equivalent to the user's long term password. 588 Care has to be taken when these OAuth credentials are used for 589 actions like changing passwords (as it is possible with some 590 protocols, e.g., XMPP [RFC6120]). The resource server should 591 ensure that actions taken in the authenticated channel are 592 appropriate to the strength of the presented credential. 594 Lifetime of the appliation sessions. 596 It is possible that SASL will be authenticating a connection and 597 the life of that connection may outlast the life of the access 598 token used to establish it. This is a common problem in 599 application protocols where connections are long-lived, and not a 600 problem with this mechanism per se. Resource servers may 601 unilaterally disconnect clients in accordance with the application 602 protocol. 604 Access tokens have a lifetime. 606 Reducing the lifetime of an access token provides security 607 benefits and OAuth 2.0 introduces refresh tokens to obtain new 608 access token on the fly without any need for a human interaction. 609 Additionally, a previously obtained access token may be revoked or 610 rendered invalid at any time by the authorization server. The 611 client may request a new access token for each connection to a 612 resource server, but it should cache and re-use valid credentials. 614 6. Internationalization Considerations 616 The identifer asserted by the OAuth authorization server about the 617 resource owner inside the access token may be displayed to a human. 618 For example, when SASL is used in the context of IMAP the resource 619 server may assert the resource owner's email address to the IMAP 620 server for usage in an email-based application. The identifier may 621 therefore contain internationalized characters and an application 622 needs to ensure that the mapping between the identifier provided by 623 OAuth is suitable for use with the application layer protocol SASL is 624 incorporated into. 626 At the time of writing the standardization of the various claims in 627 the access token (in JSON format) is still ongoing, see 628 [I-D.ietf-oauth-json-web-token]. Once completed it will provide a 629 standardized format for exchanging identity information between the 630 authorization server and the resource server. 632 7. IANA Considerations 634 7.1. SASL Registration 636 The IANA is requested to register the following SASL profile: 638 SASL mechanism profile: OAUTHBEARER 640 Security Considerations: See this document 642 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: OAUTH10A 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 8. References 665 8.1. Normative References 667 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 668 Requirement Levels", BCP 14, RFC 2119, March 1997. 670 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 671 (SHA1)", RFC 3174, September 2001. 673 [RFC4422] Melnikov, A. and K. Zeilenga, "Simple Authentication and 674 Security Layer (SASL)", RFC 4422, June 2006. 676 [RFC4627] Crockford, D., "The application/json Media Type for 677 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 679 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 680 Encodings", RFC 4648, October 2006. 682 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 683 Specifications: ABNF", STD 68, RFC 5234, January 2008. 685 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 686 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 688 [RFC5801] Josefsson, S. and N. Williams, "Using Generic Security 689 Service Application Program Interface (GSS-API) Mechanisms 690 in Simple Authentication and Security Layer (SASL): The 691 GS2 Mechanism Family", RFC 5801, July 2010. 693 [RFC5849] Hammer-Lahav, E., "The OAuth 1.0 Protocol", RFC 5849, 694 April 2010. 696 [RFC6749] Hardt, D., "The OAuth 2.0 Authorization Framework", RFC 697 6749, October 2012. 699 [RFC6750] Jones, M. and D. Hardt, "The OAuth 2.0 Authorization 700 Framework: Bearer Token Usage", RFC 6750, October 2012. 702 8.2. Informative References 704 [I-D.ietf-oauth-json-web-token] 705 Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 706 (JWT)", draft-ietf-oauth-json-web-token-18 (work in 707 progress), March 2014. 709 [I-D.ietf-oauth-v2-http-mac] 710 Richer, J., Mills, W., Tschofenig, H., and P. Hunt, "OAuth 711 2.0 Message Authentication Code (MAC) Tokens", draft-ietf- 712 oauth-v2-http-mac-05 (work in progress), January 2014. 714 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 715 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 716 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 718 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 719 4rev1", RFC 3501, March 2003. 721 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 722 October 2008. 724 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 725 Protocol (XMPP): Core", RFC 6120, March 2011. 727 [RFC6819] Lodderstedt, T., McGloin, M., and P. Hunt, "OAuth 2.0 728 Threat Model and Security Considerations", RFC 6819, 729 January 2013. 731 [RFC7033] Jones, P., Salgueiro, G., Jones, M., and J. Smarr, 732 "WebFinger", RFC 7033, September 2013. 734 Appendix A. Acknowlegements 736 The authors would like to thank the members of the Kitten working 737 group, and in addition and specifically: Simon Josefson, Torsten 738 Lodderstadt, Ryan Troll, Alexey Melnikov, Jeffrey Hutzelman, Nico 739 Williams, and Matt Miller. 741 This document was produced under the chairmanship of Alexey Melnikov, 742 Tom Yu, Shawn Emery, Josh Howlett, Sam Hartman. The supervising area 743 director was Stephen Farrell. 745 Appendix B. Document History 747 [[ to be removed by RFC editor before publication as an RFC ]] 749 -14 751 o Last call feedack on RFC citations needed, small editorial. 753 o Added the "user" parameter back, which was pulled when we started 754 down the GS2 path. Same language as -03. 756 o Defined a stub GS2 header to make sure that when the GS2 bride is 757 defined for this that nothing will break when it actually starts 758 to get populated. 760 -13 762 o Changed affiliation. 764 -12 766 o Removed -PLUS components from the specification. 768 -11 770 o Removed GSS-API components from the specification. 772 o Updated security consideration section. 774 -10 776 o Clarifications throughout the document in response to the feedback 777 from Jeffrey Hutzelman. 779 -09 781 o Incorporated review by Alexey and Hannes. 783 o Clarified the three OAuth SASL mechanisms. 785 o Updated references 787 o Extended acknowledgements 789 -08 791 o Fixed the channel binding examples for p=$cbtype 793 o More tuning of the authcid language and edited and renamed 3.2.1. 795 -07 797 o Struck the MUST langiage from authzid. 799 o 801 -06 803 o Removed the user field. Fixed the examples again. 805 o Added canonicalization language. 807 o 809 -05 811 o Fixed the GS2 header language again. 813 o Separated out different OAuth schemes into different SASL 814 mechanisms. Took out the scheme in the error return. Tuned up 815 the IANA registrations. 817 o Added the user field back into the SASL message. 819 o Fixed the examples (again). 821 o 823 -04 825 o Changed user field to be carried in the gs2-header, and made gs2 826 header explicit in all cases. 828 o Converted MAC examples to OAuth 1.0a. Moved MAC to an informative 829 reference. 831 o Changed to sending an empty client response (single control-A) as 832 the second message of a failed sequence. 834 o Fixed channel binding prose to refer to the normative specs and 835 removed the hashing of large channel binding data, which brought 836 mroe problems than it solved. 838 o Added a SMTP examples for Bearer use case. 840 -03 842 o Added user field into examples and fixed egregious errors there as 843 well. 845 o Added text reminding developers that Authorization scheme names 846 are case insensitive. 848 -02 850 o Added the user data element back in. 852 o Minor editorial changes. 854 -01 856 o Ripping out discovery. Changed to refer to I-D.jones-appsawg- 857 webfinger instead of WF and SWD older drafts. 859 o Replacing HTTP as the message format and adjusted all examples. 861 -00 863 o Renamed draft into proper IETF naming format now that it's 864 adopted. 866 o Minor fixes. 868 Authors' Addresses 870 William Mills 871 Yahoo! Inc. 873 Email: wmills_92105@yahoo.com 875 Tim Showalter 877 Email: tjs@psaux.com 878 Hannes Tschofenig 879 ARM Ltd. 880 110 Fulbourn Rd 881 Cambridge CB1 9NJ 882 Great Britain 884 Email: Hannes.tschofenig@gmx.net 885 URI: http://www.tschofenig.priv.at