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

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

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 7268712D86B for <>; Fri, 18 May 2018 09:47:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.61
X-Spam-Status: No, score=-2.61 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_LOW=-0.7, 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 18Iynn4G43jq for <>; Fri, 18 May 2018 09:47:51 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 909ED12D7F6 for <>; Fri, 18 May 2018 09:47:50 -0700 (PDT)
Received: by with SMTP id w194-v6so15098354wmf.2 for <>; Fri, 18 May 2018 09:47:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20150623; h=message-id:mime-version:to:cc:from:subject:date:importance :in-reply-to:references; bh=iEOhxOeuoizHLBg9pxsyS11u5E1+0AMgX/rqXK2I4ic=; b=fu47PQucM/bvpENZjEUmfLEF1RRR0bJYP9IRn8W5Qti3ewy+zMWm8UjTyEWvxxD/0n xfQuEMbSs7JOvZJVxIAk+lQ3B4y8Apg6Fv8E1+KYICPA1PB0InQQkSHL5HGHDXGTEBsR XdFdg+/Uxz4p+xrGhL+/13IbUVUAaGWVeQHgHHfo7J7FDgUsYHae6IT4lSa6lqI+KeSj CpD48uCZdizThMkAv1MtqnaZAICyGt/eyd04UNYMBYUhoclPoLf4Xk+Cz3sjR0Dsjouk B6E8giF7RHNfd0xME7ohvn3+WVoyYLZYZvgOVbOkp2f2r0P0MEbv6rKvcMH4IIUAa4Xw ejPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:message-id:mime-version:to:cc:from:subject:date :importance:in-reply-to:references; bh=iEOhxOeuoizHLBg9pxsyS11u5E1+0AMgX/rqXK2I4ic=; b=cir6X4MUyjYLE6VvdmlL/vrOuHpnI1leulX7Lk1Gz8dpH4q7ffT4vliZ+VAI0C7Nng osNT6Gwqzf+BXSBBxnFlRfwUgw+9geT5WNpv29C8pO/kzfWDKcgbSSRybPyMRT10kHsZ L4XSdCbNLJPyifK0CkvheH9qSA89e3yfcCxasKAxUtrugUa8a2uRtSxpYP5Bh3swJGD5 suDP8O1b/6gxlrEynpQp3wFqVx5T71JjXXC3JsvrUQQhA8x4T3Fz7uwtRrmE8acxPICU I3UHm0jXtASgECmTpZKSIH2wkfJqpzA8BZAm3bOclCGC95KetoTJMVjjLsiGfeiHkxxo ieQw==
X-Gm-Message-State: ALKqPwd00yKOfKYsbWdfywJRltza4AdZ1vKbU0ZwuFP4XO/NarVNmraU Jxi7WZyoNG3BG/TzNcyZsDEv+A==
X-Google-Smtp-Source: AB8JxZr2x5+HpReFQLCij+EEzHgDa5sSkZY5zSr0XMwAj4w9eTdmhZlwCMgX9Q74iIxVkEUvhDXJgQ==
X-Received: by 2002:a1c:700d:: with SMTP id l13-v6mr4730311wmc.81.1526662068581; Fri, 18 May 2018 09:47:48 -0700 (PDT)
Received: from ?IPv6:2001:1b18:a3:300:9cdb:2d14:3eec:54a3? ([2001:1b18:a3:300:9cdb:2d14:3eec:54a3]) by with ESMTPSA id 12-v6sm13147879wmn.27.2018. (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 09:47:47 -0700 (PDT)
Message-ID: <>
MIME-Version: 1.0
To: Brock Allen <>, David Waite <>, Hannes Tschofenig <>
Cc: "" <>
From: John Bradley <>
Date: Fri, 18 May 2018 18:47:48 +0200
Importance: normal
X-Priority: 3
In-Reply-To: <>
References: <> <> <> <,> <> <>
Content-Type: multipart/alternative; boundary="_35C3E3DF-A302-453C-A94A-97BDBBB39283_"
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:47:55 -0000

There are lots of issues with the current implicit flow around fragment encoding as well.

However moving the token used for refresh from being a HTTP only cookie to a refresh token available in the DOM makes me uncomfortable without having sufficient mitigations against XSS.

The current flow is vulnerable to  XSS for the AT, however if that is short lived it restricts the damage.

The better solution is token binding the AT and perhaps a RT.  

We need to start talking about it.  There are issues around potentially using service workers etc as well.

So we should start but I am not sure of what the correct answer is yet.

John B.

Sent from Mail for Windows 10

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

It sounds to me as if you're hesitant to recommend code flow (at least for now) then for browser-based JS apps.


On 5/18/2018 12:27:48 PM, John Bradley <> wrote:
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