Re: [OAUTH-WG] Device Code expiration and syntax

Mike Jones <> Sun, 12 March 2017 19:28 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 381401294D5 for <>; Sun, 12 Mar 2017 12:28:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.021
X-Spam-Status: No, score=-2.021 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id xVsACMDpKQdm for <>; Sun, 12 Mar 2017 12:28:54 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 577F81294AB for <>; Sun, 12 Mar 2017 12:28:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GIM08vTl9jWiP5XnzgTj0kRF3vT7XyA5Z1/h6mKFzk0=; b=gS0Tx7xGNUDYcViYiqgKRdmdzibeE7wnzX+nlpAek8wbNKmJYLVyv4EAWf1iXR2KK98X9gnSmdGPcbNqSF7B4CAOlKIbRRF3WD0m21GE21Znwi2mtLqvWBGM+XX0hlR9u6BP82Ttaz0PZVcX+J0LCHTci2EQHwg8pR3Wt1sfD0E=
Received: from ( by ( with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.0; Sun, 12 Mar 2017 19:28:53 +0000
Received: from ([]) by ([]) with mapi id 15.01.0947.023; Sun, 12 Mar 2017 19:28:53 +0000
From: Mike Jones <>
To: William Denniss <>
Thread-Topic: [OAUTH-WG] Device Code expiration and syntax
Thread-Index: AQHSmpsdXlwJ3/sQwE+4v2nL6A4fqqGQDU4AgAANDYCAAAO6gIAADfkAgABYB4CAARRA4A==
Date: Sun, 12 Mar 2017 19:28:52 +0000
Message-ID: <>
References: <> <> <> <> <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
authentication-results:; dkim=none (message not signed) header.d=none;; dmarc=none action=none;
x-originating-ip: []
x-ms-office365-filtering-correlation-id: 7234f594-42e5-43d1-057f-08d4697e04ac
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254007)(48565401081); SRVR:CY4PR21MB0503;
x-microsoft-exchange-diagnostics: 1; CY4PR21MB0503; 7:5z0fl+Uh23azWBzAGFyhwc0Shm9KBzoMiAuAWLAknOCknxRKKamTx43T433Bu2dkFCelDgTzfn3m7l1s7lPpVUbDDbQf/nF5Pa8ekO0y5WLs6Kvr4DuPFjaX4blkvcM3S5/6DvJJ2FQ4SxWDcsrQw3edB22iTeqTCyROU2hOrc0IJR2EtfRHLfI/hYiGnMUpsNtMr8iPtGbhU/kFTQ79LPINLWvoszy2xUMIQc61RWsdn23SKex71M49dRCfycOE3CF5aDCC8PCyyN/iHzhYsdRcb7eGTzqQrXUL7j0R04TUD0QK0wlhS1AN+XOOt+1ktI2Smw1oV8P7CaSyrjR9eg9EU2jgxEhienQ62W932+U=
x-microsoft-antispam-prvs: <>
x-exchange-antispam-report-test: UriScan:(158342451672863)(166708455590820)(211936372134217)(21748063052155);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123558025)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:CY4PR21MB0503; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0503;
x-forefront-prvs: 0244637DEA
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400002)(39410400002)(39450400003)(39850400002)(39860400002)(24454002)(377454003)(86362001)(2950100002)(6916009)(189998001)(66066001)(110136004)(38730400002)(53376002)(5660300001)(53936002)(6246003)(8936002)(76176999)(966004)(54356999)(3846002)(102836003)(790700001)(6116002)(50986999)(81166006)(2900100001)(8676002)(122556002)(74316002)(106116001)(7906003)(86612001)(93886004)(7736002)(19609705001)(6506006)(6306002)(54896002)(4326008)(6436002)(53546006)(236005)(5005710100001)(9686003)(551934003)(606005)(55016002)(25786008)(99286003)(8990500004)(3280700002)(3660700001)(229853002)(77096006)(33656002)(10090500001)(10290500002)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0503;; FPR:; SPF:None; MLV:sfv; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_CY4PR21MB050417103B692C096AD66F80F5220CY4PR21MB0504namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2017 19:28:52.8628 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0503
Archived-At: <>
Cc: "<>" <>
Subject: Re: [OAUTH-WG] Device Code expiration and syntax
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: OAUTH WG <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sun, 12 Mar 2017 19:28:56 -0000

Thanks for doing this, William.  I added one comment to the pull request.  After addressing it, I support this new version being published.

                                                       -- Mike

From: William Denniss []
Sent: Saturday, March 11, 2017 6:59 PM
To: Mike Jones <>
Cc: Justin Richer <>; <> <>
Subject: Re: [OAUTH-WG] Device Code expiration and syntax

Sure thing. Changes are staged here:

Includes the normative change suggested by Justin. PTAL.

On Sat, Mar 11, 2017 at 1:46 PM, Mike Jones <<>> wrote:
The pre-Chicago submission deadline is Monday afternoon (see  Would you have time to check proposed edits into GitHub for the editors to review before that, William?

                                                       -- Mike

From: OAuth [<>] On Behalf Of William Denniss
Sent: Saturday, March 11, 2017 12:54 PM
To: Justin Richer <<>>
Cc: <<>> <<>>
Subject: Re: [OAUTH-WG] Device Code expiration and syntax

On Sat, Mar 11, 2017 at 12:40 PM, Justin Richer <<>> wrote:

On Mar 11, 2017, at 2:54 PM, William Denniss <<>> wrote:

On Sat, Mar 11, 2017 at 11:10 AM, Justin Richer <<>> wrote:
We’re implementing support for the device code draft and had a question on what the “expiration” of the code refers to. Obviously, once the code has expired it can no longer be used. But when should the expiration count from? Say I have a code that’s good for 60 seconds, do I start the timer as soon as I issue the code to the client? Do I reset the timer when the user approves the client, to another 60 seconds? Or does that 60 seconds count for the entire transaction?

My read on it is the latter-- one timeout for the entire lifetime of the code regardless of its current state, with no resets. But I didn’t find good guidance in the document itself.

It's the expiry of the user_code and device_code pair, at which point the device will need to start-over with a new device authorization request.  The device wouldn't *have* to start a timer, as they will get an error during polling:


      The "device_code" has expired.  The client will need to make a new

      Device Authorization Request.

We should add some guidelines around expiry behavior.

OK, so it really is one expiration for the whole thing. The device doesn’t need to care (and I’ll bet you right now that, just like with access tokens, the overwhelmingly vast majority of devices won’t care about expires_in), but the authorization server certainly does, and we wanted to know the right place to set the timers.

You're probably right that most ignore expires_in, and I think that's fine. As long as the client handles errors correctly, it'll work out OK.

Agree that we should add some documentation. One piece of advice for the AS would be not to make it too short, else users won't be able to complete the flow in time.

We use a 30 minute expiry.

Secondly, I had a question about the “response_type” parameter to the device endpoint. This parameter is required and it has a single, required value, with no registry or other possibility of extension. What’s the point? If it’s for “parallelism”, I’ll note that this is *not* the authorization endpoint (as the user is not present) and such constraints need not apply here.

Good points here. At a guess, it bled in from the OAuth spec. If it's not needed, we should remove it.

I’d vote for removal, I don’t see the point.

 — Justin