Re: [OAUTH-WG] Token Chaining Use Case

Anthony Nadalin <tonynad@microsoft.com> Tue, 07 July 2015 23:54 UTC

Return-Path: <tonynad@microsoft.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BA2531B2A9A for <oauth@ietfa.amsl.com>; Tue, 7 Jul 2015 16:54:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pyrqMr6XBZxS for <oauth@ietfa.amsl.com>; Tue, 7 Jul 2015 16:54:38 -0700 (PDT)
Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0799.outbound.protection.outlook.com [IPv6:2a01:111:f400:fc10::799]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7872C1B2A97 for <oauth@ietf.org>; Tue, 7 Jul 2015 16:54:37 -0700 (PDT)
Received: from BY2PR03MB443.namprd03.prod.outlook.com (10.141.141.152) by BY2PR03MB1143.namprd03.prod.outlook.com (10.242.239.21) with Microsoft SMTP Server (TLS) id 15.1.195.15; Tue, 7 Jul 2015 23:54:18 +0000
Received: from BN3PR0301MB1234.namprd03.prod.outlook.com (10.161.207.22) by BY2PR03MB443.namprd03.prod.outlook.com (10.141.141.152) with Microsoft SMTP Server (TLS) id 15.1.213.10; Tue, 7 Jul 2015 23:54:16 +0000
Received: from BN3PR0301MB1234.namprd03.prod.outlook.com ([10.161.207.22]) by BN3PR0301MB1234.namprd03.prod.outlook.com ([10.161.207.22]) with mapi id 15.01.0213.000; Tue, 7 Jul 2015 23:54:15 +0000
From: Anthony Nadalin <tonynad@microsoft.com>
To: Justin Richer <jricher@mit.edu>, Mike Jones <Michael.Jones@microsoft.com>
Thread-Topic: [OAUTH-WG] Token Chaining Use Case
Thread-Index: AQHQZ/MZVBCVjU2GVU65tKvtXzLzTJ0vVM6AgKHqOwCAAA+IgIAAAY/Q
Date: Tue, 7 Jul 2015 23:54:15 +0000
Message-ID: <BN3PR0301MB1234E538E77276C68164A6E4A6920@BN3PR0301MB1234.namprd03.prod.outlook.com>
References: <D0E09E09-A803-427A-ACA9-D9E3F3EF31E5@mit.edu> <CA+k3eCSgE0Df25kPiKVnyWkkvONke6ha_FrVmZiOYYTVGM6w_w@mail.gmail.com> <BY2PR03MB442F6D96703377B6673509AF5920@BY2PR03MB442.namprd03.prod.outlook.com> <826785C8-648D-4A1B-AD8D-E99D76117C67@mit.edu>
In-Reply-To: <826785C8-648D-4A1B-AD8D-E99D76117C67@mit.edu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: mit.edu; dkim=none (message not signed) header.d=none;
x-originating-ip: [2001:4898:80e0:ee43::3]
x-microsoft-exchange-diagnostics: 1; BY2PR03MB443; 5:9Mb9OhfEKOC6oA5OLg+xe9YujVPHlpgvHJfKystky+XGOsK1zNxgC40pVyr1PkFqA6JtPb1BQKmUHXMQdd2eCjXM2t/tNOxiZofzvgVZwAIKPKld8E4hW5OMfR+GWV3Ee+/wGLOoEerVN0o5aXTPUQ==; 24:WyUKqGgmdARAqhGI0e2CjxZihDC+/4XmbWev/uYKPj77BQ/MpU0o3W1bVGbE2OUhgr+rKavEpZ2AbmOgT2ixFGb7Xhdt2lDkQv81zrCoWcc=; 20:Pj5EFUqvW7iHrMAciWa40Kpla7ZQuHB10Toiyt/32rNqDci2WjL6LmsDbtV7rJWk5JzRilVuQVzAzbvBGsrfuw==
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB443; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB1143;
by2pr03mb443: X-MS-Exchange-Organization-RulesExecuted
x-microsoft-antispam-prvs: <BY2PR03MB44339786FE50322E4638B56A6920@BY2PR03MB443.namprd03.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(108003899814671);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401001)(5005006)(3002001); SRVR:BY2PR03MB443; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB443;
x-forefront-prvs: 0630013541
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(209900001)(51444003)(24454002)(377454003)(2950100001)(2656002)(106116001)(93886004)(19300405004)(99286002)(76576001)(74316001)(46102003)(19617315012)(19580395003)(122556002)(5002640100001)(19609705001)(5001770100001)(87936001)(2900100001)(1511001)(2171001)(77156002)(62966003)(15975445007)(5001960100002)(102836002)(77096005)(92566002)(19625215002)(189998001)(40100003)(19580405001)(2561002)(76176999)(50986999)(54356999)(33656002)(16236675004)(86362001)(5003600100002)(3826002)(42262002)(4001450100001)(6606295002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB443; H:BN3PR0301MB1234.namprd03.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en;
Content-Type: multipart/alternative; boundary="_000_BN3PR0301MB1234E538E77276C68164A6E4A6920BN3PR0301MB1234_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2015 23:54:15.5283 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB443
X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1143; 2:ZHwpVjfIpa0281U/oHnCN8JiR6zwE9ng3hIItbPOrr7yq0kekcXhgyrnFq1RKnIM; 3:CkCTr7FepIu2ahrerbzMljAjL4qXvtTKXarDTjQROXqE0+eUlQNtEFB00B795rlwDw/SnJCwLnhdWuPaLaG66Kn0BSwsCjqP3XN68KrE8csdRivMiUIFsCxcpyi0Oq63gWujHvN90ZTzccp4gudKng==; 20:pLK51YVqvs4stRWazqbOWrmEENTC6plKibr0++BprxXYJgRaCBVcmLgel9JoJ77JhHCv8Zen+4Cq7kYy/6fn3ioufodA7lizYlaXg8OQo1oRxm1nV5MZNGPMxkXBPBwK3imU8xCpMblRRI9guxNgpHvBZ/qROmBTqijZIx1ZW0GTsNyEI1DKmBHA6j2nz6UJbn0+td6RUaV/gm7Q2SXStzYJ4cTL1TzBIP+CC0Lz/DWWwQHfJ+uyxBjpZSIteCQqZyBdblJfdtffzwRdaOUKCCT5VNzPJpeubWXLLo9+nBgLRlUYK2l+AaQWcXVPf1AVnGhtq2B1nvt/41LG8LfWXwKAOy9dpb+7xXv9Cm08WpA7ajdzLbY/oauSveHH3NlbeWT+YOOgQ0bQ4RdhoRBVqhv+o55mvvFzzT/QXVFxhh/ZruNcF+XEaUlGFrFuvyZKixIR0jvmYeHCTAV1G10yZFG6FI/l3V+HiDxeWv8cYArJgKbiBcOIfJmfsN4p32h8
X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB1143; 23:PAOn8OCGBTTK1ULGogPt+R4XgiMNfiYDhCpZ/5YwFbGmG7r3K89+5cJn85Fo7NaP4uUZXuxF13jrna4le37clyYlqr0TNp59I4IBo3Um2Oy53uNSctQkkxc9u2WJi9uekDJoe9cr/X+FvK6F93CdjukdQ+P8vm9LtWTcsOS78rlH8suL06/QmoeVxHbAL91WxzTjHMMLULrbDhG6Ey6AsQjWeFkXsrhNZuAfSdNfwmfHKZgfLbTODvyl0KWPYY4T
X-OriginatorOrg: microsoft.com
Archived-At: <http://mailarchive.ietf.org/arch/msg/oauth/wUJ9Hl5xWwDN6G4HedGPzT_VtOo>
Cc: "<oauth@ietf.org>" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Token Chaining Use Case
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 07 Jul 2015 23:54:41 -0000

I’m not sure how Brian’s approach solves the basic generic token exchange use case that we have

From: OAuth [mailto:oauth-bounces@ietf.org] On Behalf Of Justin Richer
Sent: Tuesday, July 7, 2015 4:47 PM
To: Mike Jones <Michael.Jones@microsoft.com>
Cc: <oauth@ietf.org> <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Token Chaining Use Case

This approach is not a good fit for my use cases, and it’s still not  OAuth-y at all. It requires a specially-formed security assertion on the way in, which the client must understand and generate. I still can’t take an arbitrary token I’ve been handed by someone else and pass it off to be pushed forward. The new “*_type” parameters seem to merely kick the can down the road instead of addressing the problems with the current specification.

I think that Brian’s approach works much better. It unrolls important parameters, properly uses the token endpoint, and allows for arbitrarily formatted input tokens.

When combined with Nat’s draft that specifies how to perform all generic OAuth requests as JWTs (or even some of the upcoming PoP work if we ever do that), you’ve pretty much got the draft below but with much more flexibility and power.

 — Justin

On Jul 7, 2015, at 6:51 PM, Mike Jones <Michael.Jones@microsoft.com<mailto:Michael.Jones@microsoft.com>> wrote:

As just updated<http://self-issued.info/?p=1412>, I believe that the working group token exchange draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-02 can now also serve the “OAuthy” token exchange use cases, such as Justin and Phil’s token chaining use case, as well as support general token exchange, including exchange of JWT and SAML tokens.  The mechanism would be the same one that Brian suggested below – defining security token type values for OAuth 2.0 access tokens and refresh tokens – enabling them to be used as inputs and outputs in any of the token exchanges.

For instance, by using “access token” as the input security token type, providing new scope values, and using “access token” as the output security token type, token chaining is achieved.

Now, a question for the working group…  What should the security token type values for access token and refresh token be?  Two different choices seem to make sense.
(1)  Use the values “access_token” and “refresh_token”, which are used in RFC 6749 token response values.
(2)  Define new URNs for this usage, such as urn:ietf:params:oauth:token-type:access-token and urn:ietf:params:oauth:token-type:refresh-token.

I’d personally be fine just using the short names in (1).

If people agree with this approach, we can document this usage in the -03 draft and publish it as soon as the submission tool reopens Monday morning during IETF 93.

                                                                -- Mike

From: OAuth [mailto:oauth-bounces@ietf.org] On Behalf Of Brian Campbell
Sent: Thursday, March 26, 2015 3:15 PM
To: Justin Richer
Cc: <oauth@ietf.org<mailto:oauth@ietf.org>>
Subject: Re: [OAUTH-WG] Token Chaining Use Case

This kind of token exchange might involve exchanges other than swapping an AT for another AT (and downscoping it). It might be an AT for a structured JWT specifically targeted at one of the the particular services that the original RS needs to call. Or an AT might be exchanged for a SAML assertion to use with legacy SOAP serveries.  A good general token exchange mechanism enables lots of variations of cases like the one Justin mentioned. And more. In fact, I think downscoping might be a minority use case where what token exchange is often need for is translating tokens from what you have into what the resource you need to call can deal with.
There need to be ways for the caller to tell the AS about the token it's asking for - by type or by the address/identifier of where it'll be used. There needs to be ways for the caller to authenticate to the AS. And there needs to be some way of expressing this delegation thing (though I'm still not totally convinced it couldn't be just the token is about the user/principal and the caller/client of the exchange is who is being delegated to).
I realize few (approaching zero) people have or are going to read it but I have endeavored to cover all these things in the http://tools.ietf.org/html/draft-campbell-oauth-sts-02 draft. It's an early draft so not without it some rough edges but can provide some guidance on what is needed and offers some protocol syntax for expressing it. I believe Justin's use case would be covered by it (defining a specific token type URI for an OAuth access token issued by the AS in question might be needed) as are many others.

On Thu, Mar 26, 2015 at 1:31 PM, Justin Richer <jricher@mit.edu<mailto:jricher@mit.edu>> wrote:
As requested after last night’s informal meeting, here is the token chaining use case that I want to see represented in the token swap draft.


[ Client ]  ->   [ A ] -> [ B ] -> [ C ]

An OAuth client gets an access token AT1, just like it always would, with scopes [A, B, C] in order to call service A, which requires all three scopes. Service A (an RS) accepts this token since it has its scope, and then needs to call service B in turn, which requires scopes [B, C]. It could just re-send the token it got in, AT1, but that would give the downstream RS the ability to call services with scope [ A ] and it should not be allowed to do that. To limit exposure, service A calls a token swap at the AS to create AT2 with scopes [ B, C ], effectively acting as an OAuth client requesting a downscoped token based on AT1. Service A then acts as an OAuth client to call service B, now acting as an RS to service A’s client, and can fulfill the request. And it’s turtles all the way down: Service B can also call service C, and now B acts as a client, requesting AT3 with scope [ C ] based on AT2, and sending AT3 to service C. This prevents C from being able to call B or A, both of which would have been available if AT1 had been passed around. Note that service A or the Client can also request a downscoped token with [ C ] to call service C directly as well, and C doesn’t have to care how it got there.


In other words, it lets the client software be very, very dumb. It doesn’t have to do any special processing, doesn’t have to know what’s in the token, it just follows the recipe of “I got a token, I get another token based on this to call someone else”. It’s also analogous to the refresh token flow, but with access tokens going in and out. I’ve deployed this setup several times in different service deployments. Even though there is a performance hit in the additional round trips (as Phil brought up in another thread), in these cases the desire to have the tokens hold least privilege access rights (smallest set of scopes per service) outweighed any performance hit (which was shown to be rather small in practice).

What I want is for the token swap draft to define or use a mechanism that allows us to do this. I think we can do that pretty easily by adjusting the token swap syntax and language, and explicitly calling out the semantic processing portion (the current core of the document) for what it is: a way for a token issuer to communicate to a token service specific actions. At a high level, the spec would be something like:



1. How to swap a token at an AS
  1. Send a request to the token endpoint with a new grant type, and a token (of any type/format/flavor) on the way in
  2. Get back a new token in a token response
2. Communicating act as / on behalf of semantics via a JWT assertion
  1. How to create (as an AS/RS/client/other issuer) a JWT with act-as semantics
  2. What to do (as an AS/RS) with a JWT with act-as semantics
  3. How to create a JWT with on-behalf-of semeantics
  4. What to do with a JWT with on-behalf-of-semantics
  5. How to possibly represent these semantics with something other than a JWT



Section 2 uses the syntax from section 1. Other applications, like the one I laid out above, can use the syntax from section 1 as well. This works for structured, unstructured, self-generated, cross-domain, within-domain, and other tokens.


 — Justin

_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth