> For the complete documentation index, see [llms.txt](https://deskpro.gitbook.io/apps-developer-guide-old/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://deskpro.gitbook.io/apps-developer-guide-old/oauth2/how-do-i-customize-oauth2-requests.md).

# 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](https://www.jetbrains.com/help/hub/Authorization-Code.html) 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](https://deskpro.github.io/apps-sdk-core/reference/OauthFacade.html) class:

## Passing extra parameters when requesting access

Access requests are handled via the `authorization code` flow. To add your parameters, add a `query` property:

```jsx
// obtain a reference to the oauth client from the application client
const { oauth } = dpapp

// request a refresh token to be sent 
oauth.access('youtrack', { 
    query: { 'access_type' : 'offline' } 
}).then(resp => console.log(resp.refresh_token))
```

## 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:

```jsx
// obtain a reference to the oauth client from the application client
const { oauth } = dpapp

// request a refresh token to be sent 
oauth.refresh('youtrack', { 
    query: { 'refresh_token' : 'access-tokens' } 
}).then(resp => console.log(resp.access_token))
```
