oauth tutorial - Oauth- authorization code grant in oauth - oauth tutorial - oauth guides - oauth tutorial - oauth - oauth2 tutorial - oauth authentication
Authorization Code Grant
The Authorization Code grant type is used when the client wants to request access to protected resources on behalf of another user (i.e. a 3rd party). This is the grant type most often associated with OAuth.
![authorization code grant in oauth](https://wikitechy.com/tutorials/oauth/img/oauth-images/authorization-code-grant-in-oauth.png)
Learn oauth - oauth tutorial - authorization code grant in oauth - oauth examples - programs
Step 1
GET /authorize?response_type=code&client_id=[APP_KEY]&state=[RANDOM_STRING]
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
&scope=[OPTIONAL_SCOPES] HTTP/1.1
Host: server.example.com
click below button to copy the code. By - oauth tutorial - oauth2 tutorial - team
![authorization code grant in oauth step1](https://wikitechy.com/tutorials/oauth/img/oauth-images/authorization-code-grant-in-oauth-step1.png)
Learn oauth - oauth tutorial - authorization code grant in oauth step1 - oauth examples - programs
Step 2
POST /token HTTP/1.1
Host: server.example.com
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&code=[CODE_FROM_STEP1]
&client_id=[APP_KEY]&client_secret=[APP_SECRET]
&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb
<https://tools.ietf.org/html/rfc6749>