OAuth 2.0
An authorization protocol by which an application obtains an access token on behalf of a user to access a third-party service. The user grants permission, and the application works with the token.
Why It Is Needed
To avoid storing another user's login and password. Instead:
- the user logs in to the website and grants permission;
- the application receives an
access_token; - it then accesses the API only with the token.
Key Concepts
- access_token — the access key itself, often permanent;
- scope — what access is granted (for example, only products);
- redirect_uri — where to return the user after granting permission.
Nuance
The token can be passed in the header Authorization: Bearer ... or as a query parameter access_token=.... Some WAF cut the header — then a form with the token in the URL helps.