Authorization Code

The Authorization Code grant is similar to the implicit grant type, however, there is an additional step that requires a user to "authorize" the partner access to their user data. For comparison, this flow is very similar to other well-known IDP authorization process's.

The authorization code is obtained by using an authorization server as an intermediary between the Client and Resource Owner. Instead of requesting authorization directly from the Resource Owner, the Client directs the Resource Owner to an authorization server, which in turn directs the Resource Owner back to the Client with the Authorization Code.

Before directing the Resource Owner back to the Client with the Authorization Code, the Authorization Server authenticates the Resource Owner and obtains authorization. Because the Resource Owner only authenticates with the Authorization Server, the Resource Owner's credentials are never shared with the Client. For more information, refer to Authorization Code Grant.

Once the access_token is returned, the Userinfo endpoint may now be called with the access_token to retrieve details about the User. For more information about /userinfo, refer to Userinfo Endpoint Information.

Sample Authorization Code Request:

POST {{url}}/oauth/authorize?

Sample JSON Response:

HTTP/1.1 302 Found

Sample Token Request

POST /auth/token HTTP/1.1
      Host: {{url}}
      Content-Type: application/json
      Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW

Sample JSON Response:

  "refresh_token": "8xLOxBtZp8",