authorization_code

authorization_code

This grant type is for server side web applications. We will need a redirect URL provided by you to where the user should be redirected after successful login.

    • Redirect the user to
      • /oauth/authorize?response_type=code&client_id=CLIENT_ID
    • The user logs in and approves your required scopes.
    • The user is redirected to your application.
      • YOUR_REDIRECT_URL?code=CODE
    • Extract the CODE value from the URL parameter.
    • Your backend application must request an access token.
      • POST Request
      • URL: /oauth/token?grant_type=authorization_code&code=CODE
      • Basic Auth: CLIENT_ID:CLIENT_SECRET
    • Example Response:
    • {
      "access_token": "6dc65b83-6d78-4b80-8ad2-6fac14a9e7c7", 
      "token_type": "bearer",
      "expires_in": 43199, 
      "scope": "files_folders sharing" 
      }
    • Extract the token from the response body and use it to for your rest request.