Re: [OAUTH-WG] is updated guidance needed for JS/SPA apps?

John Bradley <> Fri, 18 May 2018 16:27 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 0DD7412DA24 for <>; Fri, 18 May 2018 09:27:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id iFxMUJ55gqD5 for <>; Fri, 18 May 2018 09:27:49 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:400e:c01::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id E3CFC12D7F6 for <>; Fri, 18 May 2018 09:27:48 -0700 (PDT)
Received: by with SMTP id az12-v6so4870213plb.8 for <>; Fri, 18 May 2018 09:27:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20150623; h=from:to:cc:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:accept-language:content-language :mime-version; bh=z7xGdxgQKklG4YpJxjismejjQd+a6QzaaMH5jHRip+U=; b=kgnmNXA20BbM1H6UpPmQKsvBuS54b3GE7WrQe80/WM0qB3Y7TdJlzeVLYBKSezeIiu pMumL4PNQOdphPi55EkOoopZKVi9R41rS5yAktfHUVBj69PuOXYMzWMAnIlAWGT0/BvB ByQMHr7Pm9a1kfhVFgw6jXV4/3ijvxC5MCvRr+H/WQpe0i8nSWlkPScVnhUi4EqGeHEV EO4XzP0zSK1KI8Q/Bku+JQ96gctxVYvCGtCb5thAmtiePnaHMaKSNiXcktrrt/13BW2B dDALBpkYhfsaeM/+2akrlK4Wvx+ltWN0I3Ow4vvh/Y5UVR7CBu805NuHZHfJ32xBMuPw /fnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:from:to:cc:subject:thread-topic:thread-index :date:message-id:references:in-reply-to:accept-language :content-language:mime-version; bh=z7xGdxgQKklG4YpJxjismejjQd+a6QzaaMH5jHRip+U=; b=Mxsv7HiHWvdMgDsMIZOygeIRhBWYNJXKBqyMPRcv/pJemWVlhiJcthuelrL4r1flc3 0SkCUgmaomX/j33eBIfz/gD824VXyXOxtuOhi8X0mcu9cUOWBGy3sRIrC6XiBU08gEG+ Hb+m1o/n2/b5W4oAG4U70eqLFR8goXE4ifPtMA/vdUMI23gUMdm1iC9exYu2GYWEvm15 8cj5xFQfeq6LqR81HsWIUdoVS6tPKDF4ZP+sneOBMzCf9/OS6TuKm3oT7vSENjz568Cy Hh4kR4EVHjZc2tStE/VMUm6qExJeXp4uTCOto1Kf8+j1DTc0WAywAc7DRNbi+KT5axG+ 0Dwg==
X-Gm-Message-State: ALKqPwcIQKljLyZGygkZcWYf+qxnU0pbwfaL7yzQVTTeVpEDc+cO+vvX N7A2tucTsrfVCsq6V97OALdDgJjsEuc=
X-Google-Smtp-Source: AB8JxZrmA75OiQvax7cXv+jk/yeAzSF8LrqIDf03OPRJYQkYVAvh0E9E4XX1roOu9u2pVkqxgX9PrQ==
X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr10100710plz.336.1526660867330; Fri, 18 May 2018 09:27:47 -0700 (PDT)
Received: from ([]) by with ESMTPSA id a11-v6sm11650001pgn.64.2018. (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 09:27:46 -0700 (PDT)
From: John Bradley <>
To: David Waite <>, Hannes Tschofenig <>, Brock Allen <>
CC: "" <>
Thread-Topic: [OAUTH-WG] is updated guidance needed for JS/SPA apps?
Thread-Index: AWMzMzRhARJ9niN08bKlsluLh7fMazBFM0EwQjA2NDEyNjI0OdxRxv++
X-MS-Exchange-MessageSentRepresentingType: 2
Date: Fri, 18 May 2018 16:27:38 +0000
Message-ID: <>
References: <> <> <>, <>
In-Reply-To: <>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Exchange-Organization-SCL: -1
X-MS-Exchange-Organization-RecordReviewCfmType: 0
Content-Type: multipart/alternative; boundary="_000_MWHPR19MB1085FC4579E0A656BB78A8ABFA900MWHPR19MB1085namp_"
MIME-Version: 1.0
Archived-At: <>
Subject: Re: [OAUTH-WG] is updated guidance needed for JS/SPA apps?
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: OAUTH WG <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 18 May 2018 16:27:52 -0000

Yes that was the original intent to have the AT be short lived and refresh the AT via the authorization endpoint based on the session cookie.

The session cookie should also be flagged as http only to protect it.

Having a refresh token in local storrage may introduce new security issues unless it is token bound.

Understanding the security issues of the code flow in the browser is important, before any new recommendation.

John B.

From: Brock Allen
Sent: Friday, May 18, 2:46 PM
Subject: Re: [OAUTH-WG] is updated guidance needed for JS/SPA apps?
To: David Waite, Hannes Tschofenig

One thing I maybe should have listed in the pros/cons in my original email is session management and token lifetime considerations, keeping in mind the original intent of the implicit flow.

What I mean is that with implicit grant type, the client's ability to get new access tokens is limited to the user's session at the AS/OP. Obviously other flows make more sense to obtain longer lived access (via refresh tokens), but I don't know about a browser-based JS app. In a sense there's a bit of protection for the end user built into that design by virtue of being tied to the user's cookie at the AS/OP.

Just throwing that out as an additional discussion point.


On 5/18/2018 6:04:47 AM, David Waite <> wrote:
I have written some guidance already (in non-RFC format) on preferring code for single page apps, and other security practices (CORS, CSP). From the AS point of view, it aligns well with the native apps BCP. There are benefits of thinking about native and SPA apps just as ‘public clients’ from a policy/properties point of view. It also greatly simplifies OAuth/OIDC support on both the AS administrator and client developer side when converting web properties into native apps using technologies like Electron or Cordova.

For the later requirements in the list around token policy, I am not sure these are requirements for single page apps per se. I don’t believe the need for a policy using short-lived refresh tokens, revoking at signout, or use of the revocation endpoint are different from browser and native applications. Rather they seem to be a function of usage patterns that an AS may need to support, and we happen to sometimes associate those usage patterns with typical usage of native apps vs of browser apps. For example, browser login on a borrowed device can easily leak over to being app authorization - the authentication/authorization are web-based processes to achieve SSO.

I have been working on some guidance here around token lifetimes and policies, but I don’t know whether that brings in too much AS/OP business logic (and, likely implied product/deployment features) to be industry practices.


On May 17, 2018, at 10:23 AM, Hannes Tschofenig <<>> wrote:

Hi Brock,

there have been several attempts to start writing some guidance but so far we haven’t gotten too far.
IMHO it would be great to have a document.


From: OAuth [] On Behalf Of Brock Allen
Sent: 17 May 2018 14:57
Subject: [OAUTH-WG] is updated guidance needed for JS/SPA apps?

Much like updated guidance was provided with the "OAuth2 for native apps" RFC, should there be one for "browser-based client-side JS apps"? I ask because google is actively discouraging the use of implicit flow:

>From what I can tell, the complaints with implicit are:
* access token in URL
* access token in browser history
* iframe complexity when using prompt=none to "refresh" access tokens

But this requires:
* AS/OP to support PKCE
* AS/OP to support CORS
* user-agent must support CORS
* AS/OP to maintain short-lived refresh tokens
* AS/OP must aggressively revoke refresh tokens at user signout (which is not something OAuth2 "knows" about)
* if the above point can't work, then client must proactively use revocation endpoint if/when user triggers logout

Any use in discussing this?


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________
OAuth mailing list<>