procedure RequestNewAccessToken; overload;

procedure RequestNewAccessToken(const AParams, AValues: array of string); overload;

 

Description

The RequestNewAccessToken method, without parameters, performs an AccessToken update using the previously obtained RefreshToken. Some services require updating the AccessToken before each use.

To obtain the AccessToken by using the RefreshToken, you need to define values for the following properties: ClientId, ClientSecret, RefreshToken, and TokenRequestUrl. After that, you can call out the RequestNewAccessToken method. The execution result will be saved in AccessToken.

 

The RequestNewAccessToken method with parameters doesn't use a RefreshToken, but accepts any set of parameters as open arrays.

AParams - parameter names as a string array.

AValues - parameter values as a string array.

 

Usage example

OAuth2.ClientId := <YourClientId>;

OAuth2.ClientSecret := <YourClientSecret>;

OAuth2.TokenRequestUrl := <YourRequestTokenURL>;

OAuth2.RequestNewAccessToken(['grant_type'], ['client_credentials']);

SecureBridge Components, Copyright © 2007-2025 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support