getTokenInfo method

Future<OAuthUserTokenInfo> getTokenInfo()

Returns an instance of OAuthUserTokenInfo generated by this credential.

If the access token has expired, this method regenerates it. If the OAuthUserConfiguration.refreshTokenExchangeInterval is set, this method exchanges the refresh token at specified interval. While regenerating the access token or exchanging the refresh token, if the refresh token is expired, an invalid token error is returned.

Return Value: Returns the non-expired OAuth token information generated by this credential.

Implementation

Future<OAuthUserTokenInfo> getTokenInfo() {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_OAuthUserCredential_getTokenInfoAsync(
        _handle, errorHandler);
  });
  return taskHandle
      .toFuture((element) => element.getValueAsOAuthUserTokenInfo()!);
}