Re: [OAUTH-WG] Identifying OAuth 2.0 vs 1.0 requests

Rob Richards <rrichards@cdatazone.org> Mon, 14 June 2010 21:12 UTC

Return-Path: <rrichards@cdatazone.org>
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 31F3C3A6933 for <oauth@core3.amsl.com>; Mon, 14 Jun 2010 14:12:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.299
X-Spam-Level:
X-Spam-Status: No, score=-1.299 tagged_above=-999 required=5 tests=[AWL=1.300, 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 c6QcAJyutiZL for <oauth@core3.amsl.com>; Mon, 14 Jun 2010 14:12:29 -0700 (PDT)
Received: from smtp2go.com (smtp2go.com [207.58.142.213]) by core3.amsl.com (Postfix) with ESMTP id BED043A69E3 for <oauth@ietf.org>; Mon, 14 Jun 2010 14:12:27 -0700 (PDT)
Received: from [67.158.171.203] (helo=Rob-Richardss-MacBook-Pro.local) by smtp2go.com with esmtp (Exim 4.69) (envelope-from <rrichards@cdatazone.org>) id 1OOGxJ-00029H-1k; Mon, 14 Jun 2010 21:12:29 +0000
Message-ID: <4C169B3B.80301@cdatazone.org>
Date: Mon, 14 Jun 2010 17:12:27 -0400
From: Rob Richards <rrichards@cdatazone.org>
User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228)
MIME-Version: 1.0
To: Paul Lindner <lindner@inuus.com>
References: <AANLkTilcANtf9WsFh4jJPUBkbCu5x2doTMQEr4_h_Rys@mail.gmail.com> <90C41DD21FB7C64BB94121FBBC2E72343B3EAF729E@P3PW5EX1MB01.EX1.SECURESERVER.NET> <AANLkTimz_V33JnJWsh_jgKoeGgAj1bhYhfge6-C86rJ2@mail.gmail.com> <AANLkTin5h1gtVt3CJUjaUB56w2Ku3nJODyfo91dF9J7b@mail.gmail.com> <90C41DD21FB7C64BB94121FBBC2E72343B3EAF7328@P3PW5EX1MB01.EX1.SECURESERVER.NET> <AANLkTikrS4iosFM1Xca3NIPJrVmz_9YP8cCw85zpODJL@mail.gmail.com> <4C165356.3090505@cdatazone.org> <AANLkTil9n7_4spdohdEkRUjLk9xNxhhJxovKksn6q4Mq@mail.gmail.com> <AANLkTil58NunOcS7OLnpE365YYKqvg6B_IKLOexmXly2@mail.gmail.com>
In-Reply-To: <AANLkTil58NunOcS7OLnpE365YYKqvg6B_IKLOexmXly2@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-SMTP2Go-MailScanner-Information: Please contact support@smtp2go.com for more information
X-SMTP2Go-MailScanner-ID: 1OOGxJ-00029H-1k
X-SMTP2Go-MailScanner: Found to be clean
X-SMTP2Go-MailScanner-From: rrichards@cdatazone.org
Cc: "OAuth WG (oauth@ietf.org)" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Identifying OAuth 2.0 vs 1.0 requests
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: Mon, 14 Jun 2010 21:12:33 -0000

Both of those scenarios could also be bad 1.0 calls where a 400 error 
needs to be thrown due to missing a required parameter.
So worse case is that every single parameter from a 1.0 calls needs to 
be checked that at least one of them exists in the call and then its 
still possible that it could be a bad 1.0 although it looks like 2.0.

Rob

Paul Lindner wrote:
> As stated previously the easy way to determine OAuth 1.0 vs 2.0 
> without using negative assertions is to check for the presence of 
> oauth_signature_method
>
> On Mon, Jun 14, 2010 at 1:09 PM, David Recordon <recordond@gmail.com 
> <mailto:recordond@gmail.com>> wrote:
>
>     It's easy to detect version when calling a protected resource. In
>     OAuth 2.0 you only have one token parameter whereas 1.0 has a variety
>     of parameters including a signature.
>
>     --David
>
>
>     On Mon, Jun 14, 2010 at 9:05 AM, Rob Richards
>     <rrichards@cdatazone.org <mailto:rrichards@cdatazone.org>> wrote:
>     > Wouldn't it make sense to require the oauth_version parameter
>     under 2.0 for
>     > resource calls so that the two versions can be distinguished?
>     >
>     > Rob
>     >
>     > Paul Lindner wrote:
>     >>
>     >> If you're routing requests with a load balancer it's not so
>     trivial.
>     >> Instead of a substring match you're talking about a regex with
>     negative
>     >> lookahead matching -- that's why the presence of the signature
>     param is
>     >> essential to distinguishing between 2.0/1.0a.
>     >>
>     >> On Thu, Jun 10, 2010 at 10:42 AM, Eran Hammer-Lahav
>     <eran@hueniverse.com <mailto:eran@hueniverse.com>
>     >> <mailto:eran@hueniverse.com <mailto:eran@hueniverse.com>>> wrote:
>     >>
>     >>    But in that case, all the other oauth_* parameters are missing.
>     >>    It's trivial.
>     >>
>     >>    EHL
>     >>
>     >>    > -----Original Message-----
>     >>    > From: Marius Scurtescu [mailto:mscurtescu@google.com
>     <mailto:mscurtescu@google.com>
>     >>    <mailto:mscurtescu@google.com <mailto:mscurtescu@google.com>>]
>     >>    > Sent: Thursday, June 10, 2010 10:39 AM
>     >>    > To: Paul Lindner
>     >>    > Cc: Eran Hammer-Lahav; OAuth WG (oauth@ietf.org
>     <mailto:oauth@ietf.org>
>     >>    <mailto:oauth@ietf.org <mailto:oauth@ietf.org>>)
>     >>    > Subject: Re: [OAUTH-WG] Identifying OAuth 2.0 vs 1.0 requests
>     >>    >
>     >>    > I run into the same issue. In section "4.2. URI Query
>     >>    Parameter", it would
>     >>    > help if the parameter name, oauth_token, was different
>     from OAuth 1.
>     >>    >
>     >>    > Marius
>     >>    >
>     >>    >
>     >>    >
>     >>    > On Thu, Jun 10, 2010 at 9:41 AM, Paul Lindner
>     <lindner@inuus.com <mailto:lindner@inuus.com>
>     >>    <mailto:lindner@inuus.com <mailto:lindner@inuus.com>>> wrote:
>     >>    > > I am talking about the resource server. Specifically I
>     want to
>     >>    be able
>     >>    > > to quickly determine if an incoming request is 1.0a vs 2.0.
>     >>     And since
>     >>    > > this is a library it can't make a lot of assumptions
>     about the
>     >>    > > specific environment it's running in.
>     >>    > > At first I thought I would check the oauth_version
>     parameter.  It
>     >>    > > turns out the 1.0a spec says that it is optional.  The only
>     >>    one that
>     >>    > > is required for 1.0a is oauth_signature_method.
>     >>    > > Sadly we're long past time to change the spec to
>     optimize for
>     >>    this use-case.
>     >>    > >  (It would have been better to have a parameter for
>     oauth 2.0
>     >>    that is
>     >>    > > distinct from 1.0a)  At the very least this message will
>     live
>     >>    on in
>     >>    > > the mailing list archives -- at best we document the
>     proper way to
>     >>    > > distinguish between the two versions somewhere.
>     >>    > > On Thu, Jun 10, 2010 at 8:44 AM, Eran Hammer-Lahav
>     >>    > > <eran@hueniverse.com <mailto:eran@hueniverse.com>
>     <mailto:eran@hueniverse.com <mailto:eran@hueniverse.com>>>
>     >>    > > wrote:
>     >>    > >>
>     >>    > >> The request is very different on the resource server.
>     On the
>     >>    > >> authorization server, why would you use the same endpoint?
>     >>    > >>
>     >>    > >>
>     >>    > >>
>     >>    > >> EHL
>     >>    > >>
>     >>    > >>
>     >>    > >>
>     >>    > >> From: oauth-bounces@ietf.org
>     <mailto:oauth-bounces@ietf.org> <mailto:oauth-bounces@ietf.org
>     <mailto:oauth-bounces@ietf.org>>
>     >>    [mailto:oauth-bounces@ietf.org
>     <mailto:oauth-bounces@ietf.org> <mailto:oauth-bounces@ietf.org
>     <mailto:oauth-bounces@ietf.org>>] On
>     >>    > >> Behalf Of Paul Lindner
>     >>    > >> Sent: Thursday, June 10, 2010 8:24 AM
>     >>    > >> To: OAuth WG (oauth@ietf.org <mailto:oauth@ietf.org>
>     <mailto:oauth@ietf.org <mailto:oauth@ietf.org>>)
>     >>    > >> Subject: [OAUTH-WG] Identifying OAuth 2.0 vs 1.0 requests
>     >>    > >>
>     >>    > >>
>     >>    > >>
>     >>    > >> Hi,
>     >>    > >>
>     >>    > >>
>     >>    > >>
>     >>    > >> As I've been working through our oauth2 implementation I've
>     >>    noticed
>     >>    > >> that it's not easy to disambiguate OAuth 1.0a vs 2.0 API
>     >>    calls based
>     >>    > >> on the request parameters alone.   Based on some
>     >>    investigative at the
>     >>    > >> Shindig project it appears that the only standard way to to
>     >>    determine
>     >>    > >> 1.0a vs 2.0 is by checking for the oauth_signature_method
>     >>    > parameter.  More info here:
>     >>    > >>
>     >>    > >>
>     >>    > >>
>     >>    > >> https://issues.apache.org/jira/browse/SHINDIG-1361
>     >>    > >>
>     >>    > >>
>     >>    > >>
>     >>    > >> Has anyone else considered this use case?  How did you
>     solve it?
>     >>    > >>
>     >>    > >>
>     >>    > >
>     >>    > > _______________________________________________
>     >>    > > OAuth mailing list
>     >>    > > OAuth@ietf.org <mailto:OAuth@ietf.org>
>     <mailto:OAuth@ietf.org <mailto:OAuth@ietf.org>>
>     >>    > > https://www.ietf.org/mailman/listinfo/oauth
>     >>    > >
>     >>    > >
>     >>
>     >>
>     >>
>     ------------------------------------------------------------------------
>     >>
>     >> _______________________________________________
>     >> OAuth mailing list
>     >> OAuth@ietf.org <mailto:OAuth@ietf.org>
>     >> https://www.ietf.org/mailman/listinfo/oauth
>     >>
>     >
>     > _______________________________________________
>     > OAuth mailing list
>     > OAuth@ietf.org <mailto:OAuth@ietf.org>
>     > https://www.ietf.org/mailman/listinfo/oauth
>     >
>
>