createWithChallenge static method

Future<TokenCredential> createWithChallenge(
  1. ArcGISAuthenticationChallenge challenge, {
  2. required String username,
  3. required String password,
  4. int tokenExpirationInterval = 0,
})

Creates a TokenCredential with information needed to access an ArcGIS resource.

Parameters:

  • challenge — An ArcGISAuthenticationChallenge object from which to construct the TokenCredential.
  • username — The username used to access the secured resource or retrieve a token.
  • password — The password used to access the secured resource or retrieve a token.
  • tokenExpirationInterval — The duration the token will remain valid, represented in minutes. The value must be greater than 0, otherwise the server default is used.

Return Value: Returns a TokenCredential.

Implementation

static Future<TokenCredential> createWithChallenge(
  ArcGISAuthenticationChallenge challenge, {
  required String username,
  required String password,
  int tokenExpirationInterval = 0,
}) async {
  await _packageInfoCompleter.future;
  return _createWithChallenge(
    challenge,
    username: username,
    password: password,
    tokenExpirationInterval: tokenExpirationInterval,
  );
}