Refresh the token

You can obtain a refresh token as part of the access token.

The refresh token is a token with a longer expiration time that allows clients to obtain a new set of access_token and refresh_token without requiring the user to authenticate again.

Use this code to refresh the access token:

var client = new OAuth2Client(new Uri(OAuth2TokenEndpoint), ClientId, ClientSecret);
TokenResponse response = client.RequestRefreshTokenAsync(this.RefreshTokenTextBox.Text).Result;