sedovalx / oauth2-tester

Small application to test responses from different OAuth 2.0 API endpoints
0 stars 0 forks source link

Operation for exchanging the auth code for token #7

Closed sedovalx closed 8 years ago

sedovalx commented 8 years ago

Front end should call backend operation to start exchange process. Add server method to exchange authorization code for access (and refresh) token. Input:

Output:

Frontend should pass in an authorization code obtained on the previous step. The backend handler for the client request should

TOKEN_ENDPOINT?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=CALLBACK_URL

Token info has the format:

{
    "access_token":"ACCESS_TOKEN",
    "token_type":"bearer",
    "expires_in":2592000,
    "refresh_token":"REFRESH_TOKEN",
    "scope":"read"
}

with possible additional fields.

sedovalx commented 8 years ago

Closing as double of #18