A credential that accesses token-secured ArcGIS content and services. More...
Header | #include <Authentication/ |
Since | Esri |
Inherits | Esri |
Public Functions
virtual | ~ |
std | token |
Q | token |
Static Public Members
Q | create |
Q | create |
Q | create |
Detailed Description
To create a token credential, provide a secured service URL, valid case-sensitive username, and password. Alternatively, you can create a token credential for network secure resources that are secured using network authentication, such as Integrated Windows Authentication (IWA) or Public Key Infrastructure (PKI). In both cases, you can specify a token expiration in minutes.
If you use this TokenCredential as part of the secure resource challenge handling, it will be stored in the ArcGISCredentialStore of the AuthenticationManager. It will be used by all subsequent requests that have a matching URL context.
Member Function Documentation
[override virtual noexcept]
TokenCredential::~TokenCredential ()
Destructor.
[static]
QFuture <Esri::ArcGISRuntime::Authentication::TokenCredential *> TokenCredential::createAsync (const QUrl &url, const QString &username, const QString &password, std::optional <int> tokenExpirationInterval , QObject *parent = nullptr)
Creates a TokenCredential to access a secured ArcGIS resource.
- url - The URL of the token-secured resource.
- username - The case-sensitive username used to access the secured resource or retrieve a token.
- password - The password used to access the secured resource or retrieve a token.
- tokenExpirationInterval - The duration the token will remain valid, represented in minutes. The value must be greater than 0, otherwise the server default is used.
- parent - The optional parent QObject.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
[static]
QFuture <Esri::ArcGISRuntime::Authentication::TokenCredential *> TokenCredential::createNetworkSecuredAsync (const QUrl &url, const QString &username, std::optional <int> tokenExpirationInterval , QObject *parent = nullptr)
Creates a TokenCredential with information needed to access an ArcGIS resource.
- url - The URL of the network secured resource.
- username - An optional case-sensitive 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 use std::nullopt to use the server default.
- parent - The optional parent QObject.
If the required network credential is not available in the network credential store, a network authentication challenge is expected to be issued.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
[static]
QFuture <Esri::ArcGISRuntime::Authentication::TokenCredential *> TokenCredential::createWithChallengeAsync (Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallenge *challenge, const QString &username, const QString &password, std::optional <int> tokenExpirationInterval , QObject *parent = nullptr)
Creates a TokenCredential for a network secured ArcGIS resource.
- challenge - An ArcGISAuthenticationChallenge object from which to construct the TokenCredential.
- username - The case-sensitive username used to access the secured resource or retrieve a token.
- password - The password used to access the secured resource or retrieve a token.
- tokenExpirationInterval - The duration the token will remain valid, represented in minutes. The value must be greater than 0, otherwise the server default is used.
- parent - The optional parent QObject.
If the required network credential is not available in the network credential store, a network authentication challenge will be raised.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
std::optional <int> TokenCredential::tokenExpirationInterval () const
Returns the length of time a token credential remains valid. Represented in minutes. If not explicitly set, the server default is used.
If unspecified, the server returns a token with an expiration interval of 120 minutes (2 hours). The server default for the maximum allowed expiration time is 21600 minutes (15 days), but this value can be configured on the server.
QFuture <Esri::ArcGISRuntime::Authentication::TokenInfo *> TokenCredential::tokenInfoAsync (QObject *parent = nullptr)
Returns an instance of TokenInfo generated by this credential with an optional parent.
If the token has expired, this method regenerates the access token. Token expiration is based on the tokenExpirationInterval.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.