getTokenInfo method

Future<TokenInfo> getTokenInfo()

Returns an instance of TokenInfo generated by this credential.

If the token has expired, this method regenerates the access token. Token expiration is based on the TokenCredential.tokenExpirationInterval.

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

Implementation

Future<TokenInfo> getTokenInfo() {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_TokenCredential_getTokenInfoAsync(
        _handle, errorHandler);
  });
  return taskHandle.toFuture((element) => element.getValueAsTokenInfo()!);
}