Re: [OAUTH-WG] 'Scope' parameter proposal

"Manger, James H" <James.H.Manger@team.telstra.com> Tue, 20 April 2010 04:06 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: oauth@core3.amsl.com
Delivered-To: oauth@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id A0E403A67A1 for <oauth@core3.amsl.com>; Mon, 19 Apr 2010 21:06:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.26
X-Spam-Level:
X-Spam-Status: No, score=-0.26 tagged_above=-999 required=5 tests=[AWL=0.641, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X2HufC7Qm3jg for <oauth@core3.amsl.com>; Mon, 19 Apr 2010 21:06:00 -0700 (PDT)
Received: from ipxano.tcif.telstra.com.au (ipxano.tcif.telstra.com.au [203.35.82.200]) by core3.amsl.com (Postfix) with ESMTP id 924343A6968 for <oauth@ietf.org>; Mon, 19 Apr 2010 21:06:00 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.52,239,1270389600"; d="scan'208";a="1584363"
Received: from unknown (HELO ipcbni.tcif.telstra.com.au) ([10.97.216.204]) by ipoani.tcif.telstra.com.au with ESMTP; 20 Apr 2010 14:05:51 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,5956"; a="938255"
Received: from wsmsg3756.srv.dir.telstra.com ([172.49.40.84]) by ipcbni.tcif.telstra.com.au with ESMTP; 20 Apr 2010 14:05:51 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by wsmsg3756.srv.dir.telstra.com ([172.49.40.84]) with mapi; Tue, 20 Apr 2010 14:05:50 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Eran Hammer-Lahav <eran@hueniverse.com>
Date: Tue, 20 Apr 2010 14:05:48 +1000
Thread-Topic: [OAUTH-WG] 'Scope' parameter proposal
Thread-Index: AcrgNopPKcA99eyRTky8xQ/Bn86fRAAA3Ifw
Message-ID: <255B9BB34FB7D647A506DC292726F6E112577842AD@WSMSG3153V.srv.dir.telstra.com>
References: <C7F1D1FC.32809%eran@hueniverse.com> <620F3756-E159-4EF3-99DC-6D74CC869739@gmail.com>
In-Reply-To: <620F3756-E159-4EF3-99DC-6D74CC869739@gmail.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Cc: OAuth WG <oauth@ietf.org>
Subject: Re: [OAUTH-WG] 'Scope' parameter proposal
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/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, 20 Apr 2010 04:06:01 -0000

>    HTTP/1.1 401 Unauthorized
>    WWW-Authenticate: Token realm='Example', scope='x2'

I assume the WWW-Authenticate response header also has an "authz-uri" parameter.

     WWW-Authenticate: Token realm='Example', scope='x2', authz-uri="https://as.example.com/"

The first time a client app gets this response all it can do is add the 'scope' to the 'authz-uri'. In which case the separate 'scope' parameter offered no advantage. The resource server could have more simply returned:

     WWW-Authenticate: Token realm='Example', authz-uri="https://as.example.com/?scope=x2"


The one situation where a 'scope' parameter can help interop (between client with no server-specific knowledge and the server) is when scopes are combined.

A client with a token for scope 'x1' that receives a 401 can request a new token that includes the extra scope 'x2' as well. Even in this situation, defining a 'scope' parameter is not necessary. The resource server knows the offered token was for scope 'x1', but scope 'x2' is required so the response can be:

     WWW-Authenticate: Token realm='Example', authz-uri="https://as.example.com/?scope=x2,x1"

The client just sees a URI and uses it to get a new token. This approach might require some resource servers to dynamically generate the 'authz-uri' value in error responses. I doubt that is too onerous.


An alternative way to support combining scopes would be to include (or reference) an existing token when requesting a new one. For instance, define an 'access_token' parameter to include when redirecting a user to the AS. This would work for updating a token for another 'scope', for a longer duration, for extra 'permissions' etc.
This is not absolutely necessary to define this extra 'access_token' parameter since the resource server could dynamically insert the current token into the returned 'authz_uri' value by itself, without requiring client code to do so.
Another difficulty is that some access_tokens should not be exposed to users. There may need to be an 'access_token_id' separate from the actual 'access_token' value.


In conclusion,
* -1 to Eran’s 'scope' proposal;
* perhaps add explicit support for updating a token (as opposed to refreshing) by referencing an existing token when getting a new one.


-- 
James Manger