Re: [OAUTH-WG] polling in the device flow

Dirk Balfanz <balfanz@google.com> Thu, 10 June 2010 00:02 UTC

Return-Path: <balfanz@google.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 6325B3A6880 for <oauth@core3.amsl.com>; Wed, 9 Jun 2010 17:02:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.487
X-Spam-Level:
X-Spam-Status: No, score=-104.487 tagged_above=-999 required=5 tests=[BAYES_05=-1.11, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 dTpwb-IN1FFN for <oauth@core3.amsl.com>; Wed, 9 Jun 2010 17:02:51 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by core3.amsl.com (Postfix) with ESMTP id D040E3A69B9 for <oauth@ietf.org>; Wed, 9 Jun 2010 17:02:50 -0700 (PDT)
Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id o5A02mlY013888 for <oauth@ietf.org>; Wed, 9 Jun 2010 17:02:51 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1276128171; bh=0brPsTJi/hpwq0sA+MFX+hWWCJk=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type; b=yFzuQjRqsVfCYrXifdtY6bNVJm6iXLMTYfo5D/F0A5x48kE1jpTxNqAxGRRPhmjn3 dzFqtON8cZOfN/l3pIe8g==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type; b=nzZ4dwHSZuwMvIFvI3tUjB8Uwo3TpMj7qmgQ2fsSqshB6GXlJ7rtVC/Wxvj4x44Aj X/GWQTDNzH46nAmX3Iesw==
Received: from iwn3 (iwn3.prod.google.com [10.241.68.67]) by wpaz29.hot.corp.google.com with ESMTP id o5A02lho005068 for <oauth@ietf.org>; Wed, 9 Jun 2010 17:02:47 -0700
Received: by iwn3 with SMTP id 3so3196417iwn.30 for <oauth@ietf.org>; Wed, 09 Jun 2010 17:02:47 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.231.59.1 with SMTP id j1mr4135271ibh.55.1276128167303; Wed, 09 Jun 2010 17:02:47 -0700 (PDT)
Received: by 10.231.68.144 with HTTP; Wed, 9 Jun 2010 17:02:47 -0700 (PDT)
In-Reply-To: <4C0F3FFF.2050209@lodderstedt.net>
References: <AANLkTimOXzscoFDtf-PO8965xuchEBJvqALiWM3O9fMl@mail.gmail.com> <4C0F3FFF.2050209@lodderstedt.net>
Date: Wed, 09 Jun 2010 17:02:47 -0700
Message-ID: <AANLkTikJ_FMF8PdKJ2ZedJ_3gtY91j745d5ZSkktLW8T@mail.gmail.com>
From: Dirk Balfanz <balfanz@google.com>
To: Torsten Lodderstedt <torsten@lodderstedt.net>
Content-Type: multipart/alternative; boundary="001485ebea30199ccf0488a1be21"
Cc: OAuth WG <oauth@ietf.org>
Subject: Re: [OAUTH-WG] polling in the device flow
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, 10 Jun 2010 00:02:52 -0000

On Wed, Jun 9, 2010 at 12:17 AM, Torsten Lodderstedt <
torsten@lodderstedt.net> wrote:

>  using mechanisms provided by the HTTP protocol sound reasonable to me.
>
> I see two questions:
>
> 1) Is 503 intended for that purpose?
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html says: "The server
> is currently unable to handle the request due to a temporary overloading or
> maintenance of the server"
> 2) Do HTTP clients supports the Retry-After header?
>

Both good question. It's probably fair to say that the original intention
for 503 did not include telling clients that the resource they're requesting
isn't quite ready yet. On the other hand, the original "overloading"
language does suggest that it's perfectly within the intentions of the
founding fathers to throttle clients if they become too pesky. Which is what
we're trying to do here: As far as OAuth is concerned, the client could just
sit there and loop and keep asking the server every 2 milliseconds. We
thought that wasn't a good idea because (among other things) that might
*overload* the server, not because OAuth wouldn't work if the clients did
that. So a 503 seems like a reasonable response there, especially since it
has that Retry-After header, which indicates that the original intent of a
503 at least included the case where the inability-to-serve was due to the
fact that he clients were coming in too fast.

As for library support for this - I'm not sure. I briefly looked at the
Apache commons client and couldn't find a, say, simple flag that would
enable some retry mechanism based on 503s and retry-after headers. Maybe I
didn't look hard enough. But it should be fairly easy to add supprot for
this to any HTTP client library, right?

Dirk.


> regards,
> Torsten.
>
> Am 08.06.2010 22:23, schrieb Dirk Balfanz:
>
> Hi guys,
>
> currently, we specify how polling should work in the device flow as part of
> the OAuth2 spec.
>
> I would argue that that polling should be handled at a lower layer of the
> stack, and that OAuth2 should be silent on the issue of polling. The benefit
> will be a simpler spec.
>
> HTTP specifies the 503 response code with the (optional) Retry-After
> response header. ASs could just use that mechanism to throttle clients,
> instead of handling it at the OAuth layer.
>
> The OAuth spec could say something like: "The client requests the access
> token after the user approves or rejects authorization. If the client cannot
> determine when the user has approved or rejected the authorization, the
> client MAY poll the server. The server MAY use throttling mechanisms such as
> 503 HTTP response codes and Retry-After response headers which, if used, the
> client MUST obey."
>
> What do you guys think?
>
> BTW, there is some precedence for this. Google's APIs use 503 response
> codes to throttle servers, e.g.
> http://code.google.com/googleapps/domain/gdata_provisioning_api_v2.0_reference.html
>
> Dirk.
>
>
> _______________________________________________
> OAuth mailing listOAuth@ietf.orghttps://www.ietf.org/mailman/listinfo/oauth
>
>