credentials method

  1. @override
Future<Credentials> credentials(
  1. {int minTtl = 0,
  2. Set<String> scopes = const {},
  3. Map<String, String> parameters = const {}}
)
override

Retrieves the credentials from the storage and refreshes them if they have already expired.

Change the minimum time in seconds that the access token should last before expiration by setting the minTtl. Use the scopes parameter to set the scope to request for the access token. If null is passed, the previous scope will be kept. Use the parameters parameter to send additional parameters in the request to refresh expired credentials.

Implementation

@override
Future<Credentials> credentials({
  final int minTtl = 0,
  final Set<String> scopes = const {},
  final Map<String, String> parameters = const {},
}) =>
    CredentialsManagerPlatform.instance
        .getCredentials(_createApiRequest(GetCredentialsOptions(
      minTtl: minTtl,
      scopes: scopes,
      parameters: parameters,
    )));