The Authentication Manager is a singleton class that, when enabled, will manage the user credentials.
public sealed class AuthenticationManager
This is for the following resources:
- ArcGIS Server resources secured using token-based authentication or using HTTP authentication. Note that only ArcGIS Server versions 10 SP 1 and greater are supported.
- Secured ArcGIS.com resources (e.g. web maps).
- Secured ArcGIS Portal resources.
A credential for accessing to an ArcGIS resource can be preset by using AddCredential(Credential). In this case the credential is used for any requests to the specified resources.
If a request to an ArcGIS resource returns an authorization error, the ChallengeHandler,
null, is called. This challenge handler can return the credential for accessing to the
If the ChallengeHandler is
null or if it does not return any credential, the Authorization
error is returned to the caller as if the request was executed out of the AuthenticationManager.
Most generally the ChallengeHandler displays the UI allowing the user to enter the username/password for accessing the resource. Unlike for WinStore application, the API does not provide any default UI for Desktop. However, a default challenge handler is set for managing the access though OAuth when the OAuthAuthorizeHandler is set.
Gets or sets the component that handles the authorization errors in order to get a valid credential object.
Gets the credentials registered by the Authentication Manager.
Gets the single AuthenticationManager instance. This is the only way to get an IdentifyManager instance.
Gets or sets the component sets the component that handles authorization by a resource owner in an oauth workflow.
Gets or sets the credential persistence.
Gets the registered servers.
Gets or sets the default suggested expiration interval (lifetime) of all tokens.
Adds a new Credential that the AuthenticationManager will use for accessing the resources.
Adds a set of new Credentials that the AuthenticationManager will use for accessing resources.
Returns the credential that supports the specified authentication type for the resource identified by the specified url.
Returns information about the server that is hosting at the specified url.
Generates a token credential object asynchronously. You need to provide the service URL. This is a helper method typically called by the UI challenging the user.
|GenerateCredentialAsync(Uri, String, String, GenerateTokenOptions)||
Generates a token credential object asynchronously. You need to provide the service URI, the username and the password. This is a helper method typically called by the UI challenging the user.
Returns a Credential object of the specified type (credentialRequestInfo.AuthenticationType) that can be used to access the secured resource identified by the input url (credentialRequestInfo.Url). If required, the challenge method will be called and should return the expected credential object. If case of Token AuthenticationType, the user is typically challenged for a username and password which are used to generate a token. This method is typically called internally when a request fails due to an "invalid credentials" error.
Register secure servers and the token endpoints. The Authentication Manager makes its best guess to determine the location of the secure server and token endpoint so in most cases calling registerServers is not necessary. However if the location of your server or token endpoint is non-standard use this method to register the location. Additionally if portal uses the OAuth authentication, it needs to be registered by this method.
Removes all stored credentials so the challenge handler will be called the next time access to a secured resource is needed.
Removes all credentials from the cache and revokes tokens if appropriate.
Removes the given credential from the cache and revokes its token if appropriate.
Removes an existing credential so the challenge handler will be called the next time an access to the resources is needed.
|.NET Standard 2.0||100.3 - 200.0|
|.NET 6.0||100.13 - 200.0|
|.NET 6.0 Windows||100.13 - 200.0|
|.NET 6.0 Android||200|
|.NET 6.0 iOS||200|
|.NET Framework||100.0 - 200.0|
|.NET 5||100.10 - 100.12|
|.NET Core 3.1||100.7 - 100.12|
|Android||100.0 - 100.15|
|iOS||100.0 - 100.15|
|UWP||100.0 - 200.0|