How do I customize OAuth2 requests
Your OAuth2 provider may support non-standard parameters when initializing flows such as the authorization code
flow or the token refresh
flow. For example, Youtrack 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 OauthFacade class:
Passing extra parameters when requesting access
Access requests are handled via the authorization code
flow. To add your parameters, add a query
property:
Passing extra parameters when refreshing access
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:
Last updated