Skip to content

ArcGISAuthenticationChallenge Class

  • ArcGISAuthenticationChallenge
  • class Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallenge

    An ArcGIS authentication challenge. More...

    Header: #include <Authentication/ArcGISAuthenticationChallenge.h>
    Since: Esri::ArcGISRuntime 200.8
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    virtual ~ArcGISAuthenticationChallenge() override
    Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallengeType arcGISAuthenticationChallengeType() const
    void cancel()
    void continueAndFail()
    void continueWithCredential(Esri::ArcGISRuntime::Authentication::ArcGISCredential *credential)
    void continueWithError(const Esri::ArcGISRuntime::Error &error)
    Esri::ArcGISRuntime::Error error() const
    quint8 previousFailureCount() const
    QUrl requestUrl() const

    Detailed Description

    An ArcGIS authentication challenge is raised by the ArcGISAuthenticationChallengeHandler if an ArcGIS secured resource requires OAuth or ArcGIS Token authentication.

    Member Function Documentation

    [override virtual noexcept] ArcGISAuthenticationChallenge::~ArcGISAuthenticationChallenge()

    Destructor.

    Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallengeType ArcGISAuthenticationChallenge::arcGISAuthenticationChallengeType() const

    Returns the type of the challenge, indicating which type of ArcGISCredential should be created to handle it.

    void ArcGISAuthenticationChallenge::cancel()

    Cancels the request that initiated the challenge.

    void ArcGISAuthenticationChallenge::continueAndFail()

    Handles the challenge without a credential, causing it to fail with the original authentication error.

    void ArcGISAuthenticationChallenge::continueWithCredential(Esri::ArcGISRuntime::Authentication::ArcGISCredential *credential)

    Handles the challenge with the specified credential.

    • credential - The credential to use when retrying the request.

    void ArcGISAuthenticationChallenge::continueWithError(const Esri::ArcGISRuntime::Error &error)

    Handles the challenge with an error that occurred while trying to generate a credential. The request that issued an authentication challenge fails with the given error.

    • error - The error that was encountered during handling of the challenge.

    Note: it is recommended to pass the original error encountered when calling createWithChallengeAsync and related methods to this function. Internal logic will check the error type to determine if a challenge should be attempted again, for example if an invalid username or password were entered, which will result in a specific error we can detect.

    Esri::ArcGISRuntime::Error ArcGISAuthenticationChallenge::error() const

    Returns the underlying error that led to this authentication challenge.

    quint8 ArcGISAuthenticationChallenge::previousFailureCount() const

    Returns the number of failed authentication attempts that occurred previously for this authentication challenge.

    The maximum number of allowed authentication attempts is 5. After reaching this limit, the request that led to this authentication challenge may fail with an error.

    QUrl ArcGISAuthenticationChallenge::requestUrl() const

    Returns the URL of the request that led to this authentication challenge.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.