4 ms·
> The Implicit flow is designed specifically for mobile apps or client side Javascript apps where embedded credentials could be compromised. The mechanics are s
by UncleMeat 9y ago
> The Implicit flow is designed specifically for mobile apps or client side Javascript apps where embedded credentials could be compromised. The mechanics are simple in that the application redirects the user to the Identity Provider to authenticate, the IdP passes back token(s), and the application uses it according to the scopes it has.
Do not use Implicit Grant in mobile apps unless interacting with an app provider (and even then, Implicit Grant still has some major footguns if you are using it for authn, which most people are). It was absolutely not "designed specifically for mobile apps." If you are talking to the browser you cannot ensure that the access token is delivered to the right place and access tokens are not bound to the relying party. If you are using the access token for authn like suggested here, you let malicious apps impersonate your users.
If you are using a mobile app and performing OAuth through the browser, use Authz Code flow with PKCE.
- idubrov 9y agoI wonder if the same recommendation (use Authorization Code Grant flow plus PKCE instead of Implicit Grant) should be made for SPA (single page applications), too.
- rdegges 9y agoUnfortunately, most SPA apps don't have a server side backed and thus cannot benefit from the additional security that the Authorization Code flow provides.
- idubrov 9y agoThey are in the same category as mobile apps in that respect, no? Both of them are "public clients" in terms of OAuth 2.0.
- rdegges 9y agoI'd actually add that implicit should never be used for mobile app unless you have no backend whatsoever.
- UncleMeat 9y agoEven then you should still use authz with pkce. At the very least nobody else should be able to get your access token. For some workflows this is all the guarantee you need.
- adumbledore 9y agoIt even says so on the official website ( https://oauth.net/2/grant-types/implicit/ https://oauth.net/2/grant-types/implicit/ ) - astonishing that they can't get this right. Maybe says something about the product?
- UncleMeat 9y agoYep. I'm fairly concerned about an identity management company publishing this information.
- caseysoftware 9y agoAuthor here - Entirely agree and we recommend using Auth Code+PKCE whenever possible. This post is intended to be the first of a few starting with the base spec. In the next one, I plan to go over the RFCs for JWT, Revocation, Inspection, PKCE, the AppAuth pattern, and probably a few others. Thanks for the note though.
- rahulrav 9y agoThanks for the shoutout to AppAuth (https://appauth.io https://appauth.io). It’s our 20% project at Google.