Show / Hide Table of Contents

Method CreateFederatedAsync

CreateFederatedAsync(Uri, ArcGISCredential?, TimeSpan, CancellationToken)

Creates an AccessTokenCredential to access a secured federated ArcGIS resource.

Declaration
public static Task<AccessTokenCredential> CreateFederatedAsync(Uri url, ArcGISCredential? portalCredential, TimeSpan tokenExpirationInterval = default, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Uri url

The URL of the token-secured federated resource.

ArcGISCredential portalCredential

A credential for the portal with which the server hosting URL is federated. If not provided, the method retrieves one from the AuthenticationManager. If none is available, the creation of the federated credential will fail.

TimeSpan tokenExpirationInterval

The requested token validity duration. 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.

CancellationToken cancellationToken

A cancellation token that can be used to cancel the operation.

Returns
Type Description
Task<AccessTokenCredential>

A task with AccessTokenCredential.

Remarks

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.

A valid portal credential is required to create a federated token credential, which can be any ArcGISCredential type.

Exceptions
Type Condition
PortalCredentialMissingException

A portal credential is not provided and the AuthenticationManager does not contain a credential for the federating portal.

CredentialCannotBeSharedException

The provided portal credential does not match the portal with which the server is federated.

ServiceNotFederatedException

The provided URL is not federated with any portal.

Applies to

Platforms and versions
TargetVersions
.NET300
.NET Windows300
.NET Android300
.NET iOS300
In this article
Provide feedback
Back to top Copyright © 2025 Esri.