Week 18 - Session 1 - User Authentication - OAuth 2.0
blog image source |
OAuth2 defines 4 roles :
The Authorization Code Grant Type; used on web servers. You’ll want to use the authorization code grant type if you are building a web application with server-side code that is NOT public. If you want to implement an AuthO flow in a server-side web framework like Express.js, Flask, Django, Ruby on Rails, an Authorization Code is the way to go.
The Implicit Grant Type; used for client-side web applications (like React.js or Angular.js) that don’t have a server-side component — or any sort of mobile application that can use a mobile web browser. Implicit grants are ideal for client-side web applications and mobile apps because this grant type doesn’t require you to store any secret key information at all — this means you can log someone into your site/app WITHOUT knowing what your application’s client_secret is.
The Password Credentials Grant Type; used for first-class web applications OR mobile applications. This is ideal for official web and mobile apps for your project because you can simplify the authorization workflow by ONLY asking a user for their username and password, as opposed to redirecting them to your site, etc.
The Client Credentials Grant Type; used for application code. You’ll want to use the client credentials grant type if you are building an application that needs to perform non-user related tasks. For instance, you might want to update your application’s metadata.
Auth0 - https://auth0.com/
Passwordless Authentication with React and Auth0 - https://medium.com/javascript-scene/passwordless-authentication-with-react-and-auth0-c4cb003c7cde
- Resource Owner: generally yourself.
- Resource Server: server hosting protected data (for example Google hosting your profile and personal information).
- Client: application requesting access to a resource server (it can be your PHP website, a Javascript application or a mobile application).
- Authorization Server: server issuing access token to the client. This token will be used for the client to request the resource server.
The Authorization Code Grant Type; used on web servers. You’ll want to use the authorization code grant type if you are building a web application with server-side code that is NOT public. If you want to implement an AuthO flow in a server-side web framework like Express.js, Flask, Django, Ruby on Rails, an Authorization Code is the way to go.
The Implicit Grant Type; used for client-side web applications (like React.js or Angular.js) that don’t have a server-side component — or any sort of mobile application that can use a mobile web browser. Implicit grants are ideal for client-side web applications and mobile apps because this grant type doesn’t require you to store any secret key information at all — this means you can log someone into your site/app WITHOUT knowing what your application’s client_secret is.
The Password Credentials Grant Type; used for first-class web applications OR mobile applications. This is ideal for official web and mobile apps for your project because you can simplify the authorization workflow by ONLY asking a user for their username and password, as opposed to redirecting them to your site, etc.
The Client Credentials Grant Type; used for application code. You’ll want to use the client credentials grant type if you are building an application that needs to perform non-user related tasks. For instance, you might want to update your application’s metadata.
Auth0 - https://auth0.com/
Passwordless Authentication with React and Auth0 - https://medium.com/javascript-scene/passwordless-authentication-with-react-and-auth0-c4cb003c7cde