Skip to content
  • 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.

    Relevant samples:

    • Configure subnetwork trace: Get a server-defined trace configuration for a given tier and modify its traversability scope, add new condition barriers and control what is included in the subnetwork trace result.
    • Create load report: Create a simple electric distribution report that displays the count of customers and total load per phase by tracing downstream from a given point.
    • Display content of utility network container: A utility network container allows a dense collection of features to be represented by a single feature, which can be used to reduce map clutter.
    • Display subtype feature layer: Displays a composite layer of all the subtype values in a feature class.
    • Display utility associations: Create graphics for utility associations in a utility network.
    • Edit with branch versioning: Create, query and edit a specific server version using service geodatabase.
    • Perform valve isolation trace: Run a filtered trace to locate operable features that will isolate an area from the flow of network resources.
    • Trace utility network: Discover connected features in a utility network using connected, subnetwork, upstream, and downstream traces.
    • Validate utility network topology: Demonstrates the workflow of getting the network state and validating the topology of a utility network.

    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.