How do I customize OAuth2 requests
Last updated
Last updated
Your OAuth2 provider may support non-standard parameters when initializing flows such as the authorization code
flow or the token refresh
flow. For example, uses the parameter access_type
in the authorization code
request to decide if it returns a refresh token alongside the regular access token.
In such cases you can do pass these extra parameters using the options
argument present in all the methods of the class:
Access requests are handled via the authorization code
flow. To add your parameters, add a query
property:
If you want to refresh an access token, you must let Deskpro know what is the storage key which points to the refresh token you obtained from a previous step. Assuming that key is named access-tokens
, your code might look like this: