Re: [OAUTH-WG] authz code randomness (was: single use authorization codes)

Eran Hammer-Lahav <eran@hueniverse.com> Thu, 15 July 2010 23:07 UTC

Return-Path: <eran@hueniverse.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 02ABF3A6BB0 for <oauth@core3.amsl.com>; Thu, 15 Jul 2010 16:07:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.473
X-Spam-Level:
X-Spam-Status: No, score=-2.473 tagged_above=-999 required=5 tests=[AWL=0.126, BAYES_00=-2.599]
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 h6111+K0J2Ys for <oauth@core3.amsl.com>; Thu, 15 Jul 2010 16:07:10 -0700 (PDT)
Received: from p3plex1out02.prod.phx3.secureserver.net (p3plex1out02.prod.phx3.secureserver.net [72.167.180.18]) by core3.amsl.com (Postfix) with SMTP id A344F3A69D5 for <oauth@ietf.org>; Thu, 15 Jul 2010 16:07:10 -0700 (PDT)
Received: (qmail 3293 invoked from network); 15 Jul 2010 23:07:21 -0000
Received: from unknown (HELO smtp.ex1.secureserver.net) (72.167.180.19) by p3plex1out02.prod.phx3.secureserver.net with SMTP; 15 Jul 2010 23:07:21 -0000
Received: from P3PW5EX1MB01.EX1.SECURESERVER.NET ([10.6.135.20]) by P3PW5EX1HT001.EX1.SECURESERVER.NET ([72.167.180.19]) with mapi; Thu, 15 Jul 2010 16:07:21 -0700
From: Eran Hammer-Lahav <eran@hueniverse.com>
To: Brian Campbell <bcampbell@pingidentity.com>
Date: Thu, 15 Jul 2010 16:07:07 -0700
Thread-Topic: [OAUTH-WG] authz code randomness (was: single use authorization codes)
Thread-Index: AcskcnpNwS1WjdkGRXWOPwGsF+2V0g==
Message-ID: <89B2A6B3-B205-4860-9366-E32CC91F8000@hueniverse.com>
References: <AANLkTinBjLAm8bEGGcKiqmJjeZE1Hfb02dFT22Hn6SZf@mail.gmail.com> <AANLkTimfrm0gBoTpfWybVHLiynD8BUvlRYM3rtB4taj9@mail.gmail.com> <AANLkTilTPIrfT07jP1pVpvKQ2DJ71rhDsLbu3Z-6eAI0@mail.gmail.com> <AANLkTilaAoeGMj8j3x3T_hsqu53DJKqXIYGil-S62YYJ@mail.gmail.com> <AANLkTim8qgctbpyRDooxLCVKBSaWWV9BDkJTje5IRmcT@mail.gmail.com>
In-Reply-To: <AANLkTim8qgctbpyRDooxLCVKBSaWWV9BDkJTje5IRmcT@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: oauth <oauth@ietf.org>
Subject: Re: [OAUTH-WG] authz code randomness (was: single use authorization codes)
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: Thu, 15 Jul 2010 23:07:12 -0000

No normative language needed. Security consideration is the right approach. 

EHL



On Jul 15, 2010, at 19:05, "Brian Campbell" <bcampbell@pingidentity.com> wrote:

> Okay, I'm with you.  Some text guiding the more obvious (to me anyway)
> usage might still be useful.   Something like,
> 
> "If Authorization Code value is a reference to state on the server,
> the value MUST/SHOULD be constructed from a cryptographically strong
> random or pseudo-random number sequence [RFC1750] where the
> probability of two Authorization Code values being identical is less
> than or equal to 2^(-160)."
> 
> It's not as clean the previous text but still maybe useful.
> 
> I'm guessing you don't want any language restricting the length of the
> code?  Though there is some practical limit due to the URL length in
> the 302 (I think it has to be a redirect).
> 
> 
> 
> On Thu, Jul 15, 2010 at 3:30 PM, Brian Eaton <beaton@google.com> wrote:
>> On Thu, Jul 15, 2010 at 2:16 PM, Brian Campbell
>> <bcampbell@pingidentity.com> wrote:
>>> I must admit to never having considered the authz code as anything but
>>> a random string as a reference that must be resolved.  Can you expand
>>> on your thinking a bit, if only to enlighten me?
>>> 
>>> Are you thinking of embedding what would be the entire access token
>>> response to the eventual authorization_code grant type request inside
>>> the access token itself and encrypting and/or singing it?
>> 
>> Yes.
>> 
>> The oauth2 authorization code and the SAML artifact are similar in
>> that they end up creating this pattern:
>> 
>> user in location A creates some value
>> value is transferred to location B
>> server in location B resolves value
>> value expires
>> 
>> If A and B are geographically distant, you end up having to replicate
>> rapidly changing state.  that's expensive, and not terribly useful.
>> 
>> If you use a stateless implementation (e.g. authorization code is a
>> signed blob containing the client-id, the user-id, the list of scopes
>> granted, a timestamp, and a hash of the callback URL) things are much
>> more efficient.  The code is a bit longer.
>> 
>> Cheers,
>> Brian
>> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth