This is part of a series post about OAuth2. In this post, I go over the implicit grant type and how it relates and differs to the authorization code grant type.
Let’s look at a high-level only flow of the implicit grant flow via an example in which an application recommends a user movies based on the movies the user’s friends like on Facebook.
For comparison, here’s the flow using the authorization code grant.
As you can see at the surface level, the implicit flow is more or less similar to the authorization code flow except it does not have the step of authenticating the client. As we discuss when to choose the implicit grant type vs the authorization grant type , we’ll explore other differences between the two flows and see they are meant for different types of applications.
Let’s talk first about why we don’t just use the authorization code grant type since it has an extra security step of authenticating the client and thus is more secure. This is because the overhead of authenticating the client offers no additional security benefits for public applications – applications that cannot secure a token. Such applications include native mobile and web applications that use javascript. When those applications pass along a client’s credentials for authentication or requesting an access token, it is not possible to hide the tokens from the resource owner and thus any malicious users. In addition, the authorization code grant type is also meant for server to server communication as it supports requesting a refresh token without a presence of the resource owner, whereas the implicit flow expects the presence of the resource owner for authorization and does not support refreshing an access token.
In summary, you should use the implicit flow if your application cannot hide the tokens from the resource owner or other users who have access to the device.
Protecting angular and ASP.NET core applications – An Overview.
Using MSAL angular to authenticate a user against azure ADB2C via authorization code flow with Proof Key for Code Exchange.
Azure AD authentication in angular using MSAL angular v2 library
Common frameworks, libraries and design patterns I use
Authenticate against azure ad using certificate in a client credentials flow
Migrating from Microsoft.AspNetCore.Authentication.AzureAD to Microsoft Identity Web authentication library to integrate with Azure AD.
Integrate Azure AD B2C reset password user flow in angular using oidc-client-js.
Integrate Azure AD B2C profile editing user flow in angular using oidc-client-js.