createFederated static method

Future<TokenCredential> createFederated({
  1. required Uri uri,
  2. ArcGISCredential? portalCredential,
  3. int tokenExpirationInterval = 0,
})

Creates a TokenCredential to access a secured federated ArcGIS resource.

Federation is a security and administrative configuration in which an ArcGIS Server is registered with an ArcGIS Enterprise portal or ArcGIS Online organization, delegating authentication and authorization to the portal. This allows the portal to manage user identities, roles, and permissions for the server's services.

This method creates a credential for a service directly using an existing portal credential, without relying on an authentication challenge or re-entering user credentials.

Parameters:

  • uri — The URL of the token-secured federated resource.
  • portalCredential — A credential for the portal with which the server hosting URL is federated. If not provided, the method retrieves one from ArcGISCredentialStore. If none is available, the creation of the federated credential will fail.
  • tokenExpirationInterval — The requested token validity duration, in minutes. If this value is less than or equal to zero, it defaults to the portal credential's token expiration interval. The server may shorten the requested duration based on its maximum token lifetime settings.

Return Value: A TokenCredential.