OAuth
OAuth
Grants Token Type (Recommend)
Authorization Code Grant with PKCE (Proof Key for Code Exchange)
single page
applicationsBrowser based
applicationnative
applications
Authorization Code Grant
server
application
Client Credentials Grant Tokens
machine-to-machine
authentication.
Personal Access Tokens
- users issue access tokens to themselves
- WITHOUT authorization code
redirect flow
No longer recommend Grants Token Type
Password Grant Tokens
first-party
clients- mobile application, to obtain an access token using an
email address
/username
andpassword
.
- mobile application, to obtain an access token using an
- We strongly recommend that you use the
Authorization Code flow
over the Password grant for several reasons.
Implicit Grant Tokens
JavaScript
ormobile applications
where the client credentials CAN’T be securely stored- token is returned to the client without exchanging an authorization code.
Question
Which OAuth 2.0 grant should I implement?
https://oauth2.thephpleague.com/authorization-server/which-grant/