OAuth Implicit Grant Login Flow
Introduction
This tutorial walks through how to use the OAuth implicit code grant. For more information on the implicit grant, see Use an Implicit Grant
Redirect to Genesys Cloud to Handle Authentication
When the page loads, we redirect the page to the authorization url and specify:
response_type: Use token since this is an implicit (token) grant. client_id: The client ID for this application. redirect_uri: The URI to which the user is redirected after login.
Get the Access Token Out of the Url
After the user follows the redirect, the URI contains a hash (#) with the access token as a parameter. We strip the parameter and save it in the token variable.
Make API Calls
Now that we have the bearer token, we can make an Ajax call to Genesys Cloud, setting the value of the Authorization parameter to bearer token, where token is the value from the hash.