Manages requests for ArcGIS secure resources made by an application. More...
Header | #include <Authentication/ |
Since | Esri |
Inherits | Esri |
Public Functions
virtual | ~ |
Esri | arc |
Esri | arc |
Esri | network |
Esri | network |
void | set |
void | set |
void | set |
Detailed Description
The authentication manager allows you to manage user credentials for accessing secured ArcGIS Online and ArcGIS Enterprise resources. The authentication manager provides a central place for you to configure authentication challenge handlers and credential stores:
- ArcGIS and network challenge handlers allow you to respond to authentication challenges. For example, you can write code in an authentication challenge handler to prompt the user for credential information, create a credential, and use it to continue with the challenge.
- Credential stores are available for storing ArcGIS and network credentials that are automatically checked when your application attempts to connect to secured resources. These stores can also be persisted so that the user does not have to sign in again when the application is re-launched.
If your application attempts to access a secure resource, and there is no matching credential in the credential store, the app raises an authentication challenge. If the ArcGIS secured resource requires OAuth or ArcGIS Token authentication, an ArcGIS authentication challenge is raised. If the ArcGIS secured resource requires network credentials, such as Integrated Windows Authentication (IWA) or Public Key Infrastructure (PKI), a network authentication challenge is raised.
To allow your app users to respond to the authentication challenge:
- Create an authentication challenge handler and pass it to the AuthenticationManager.
- Customize the challenge handler to prompt the user for a username and password and use those values to create the appropriate type of ArcGISCredential.
- Confirm that the credential permits access to the secure resource.
A successful credential, created while handling an authentication challenge, is automatically placed in the credential store of the AuthenticationManager. This store exists for the lifetime of the application and its credentials can be used when subsequent requests are made.
If you want to avoid prompting users for credentials between application sessions, you can persist the credential store. Ensure that the credentials are secured using an appropriate mechanism for your platform so they are not available to other apps or processes. During user sign-out you should clear all credentials from the credential store to prevent users accessing resources for which they do not have permission.
See the ArcGIS for Developers website for an overview of Security and authentication. Relevant samples:
- Access portal user info: Retrieve a user's details via a Portal.
- Integrated windows authentication: Uses Windows credentials to access services hosted on a portal secured with Integrated Windows Authentication (IWA).
- Show organization basemaps: Connect to Portal to give users access to their organization's basemaps.
Member Function Documentation
[override virtual noexcept]
AuthenticationManager::~AuthenticationManager ()
Destructor.
Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallengeHandler *AuthenticationManager::arcGISAuthenticationChallengeHandler () const
Returns the handler is called to handle ArcGISAuthenticationChallenge when requests are made for ArcGIS secured resources that require an OAuth or ArcGIS token authentication.
The credential provided while handling an authentication challenge is placed in the ArcGIS credential store of the ArcGISRuntimeEnvironment::authenticationManager and used by all subsequent requests that have a matching server context.
See also setArcGISAuthenticationChallengeHandler().
Esri::ArcGISRuntime::Authentication::ArcGISCredentialStore *AuthenticationManager::arcGISCredentialStore () const
Returns storage for ArcGISCredential objects. The credential store is checked for a matching credential before sending requests or issuing authentication challenges.
See also setArcGISCredentialStore().
Esri::ArcGISRuntime::Authentication::NetworkAuthenticationChallengeHandler *AuthenticationManager::networkAuthenticationChallengeHandler () const
Returns the handler is called to handle NetworkAuthenticationChallenge when such challenges are raised.
See also setNetworkAuthenticationChallengeHandler().
Esri::ArcGISRuntime::Authentication::NetworkCredentialStore *AuthenticationManager::networkCredentialStore () const
Returns storage for NetworkCredential objects.
The credential store is checked for a matching credential before sending requests or issuing authentication challenges.
void AuthenticationManager::setArcGISAuthenticationChallengeHandler (Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallengeHandler *arcGISAuthenticationChallengeHandler )
Sets the arcGISAuthenticationChallengeHandler to arcGISAuthenticationChallengeHandler.
See also arcGISAuthenticationChallengeHandler.
void AuthenticationManager::setArcGISCredentialStore (Esri::ArcGISRuntime::Authentication::ArcGISCredentialStore *arcGISCredentialStore )
Sets the arcGISCredentialStore to arcGISCredentialStore.
See also arcGISCredentialStore.
void AuthenticationManager::setNetworkAuthenticationChallengeHandler (Esri::ArcGISRuntime::Authentication::NetworkAuthenticationChallengeHandler *networkAuthenticationChallengeHandler )
Sets the networkAuthenticationChallengeHandler to networkAuthenticationChallengeHandler.
See also networkAuthenticationChallengeHandler.