createNetworkSecured static method

Future<TokenCredential> createNetworkSecured({
  1. required Uri uri,
  2. required String username,
  3. int tokenExpirationInterval = 0,
})

Creates a TokenCredential for a network secured ArcGIS resource.

If the required network credential is not available in the network credential store, a network authentication challenge will be raised.

Parameters:

  • uri — The URL of the network secured resource.
  • username — An optional username to associate with the credential. This value is informational only and can be an empty string.
  • 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.