Skip to content

ArcGISAuthenticationChallengeHandler Class

  • ArcGISAuthenticationChallengeHandler
  • class Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallengeHandler

    An interface for handling ArcGIS authentication challenges. More...

    Header: #include <Authentication/ArcGISAuthenticationChallengeHandler.h>
    Since: Esri::ArcGISRuntime 200.8
    Inherits: QObject

    Public Functions

    Protected Functions

    ArcGISAuthenticationChallengeHandler(QObject *parent = nullptr)
    virtual void handleArcGISAuthenticationChallenge(Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallenge *challenge) = 0

    Detailed Description

    Member Function Documentation

    [explicit protected] ArcGISAuthenticationChallengeHandler::ArcGISAuthenticationChallengeHandler(QObject *parent = nullptr)

    Default constructor with an optional parent.

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

    Destructor

    [pure virtual protected] void ArcGISAuthenticationChallengeHandler::handleArcGISAuthenticationChallenge(Esri::ArcGISRuntime::Authentication::ArcGISAuthenticationChallenge *challenge)

    Use ArcGISAuthenticationChallenge::continueWithCredential, ArcGISAuthenticationChallenge::continueAndFail, or ArcGISAuthenticationChallenge::cancel to handle the challenge. 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.

    • challenge - The challenge to be handled.

    It is recommended to use RAII techniques to delete challenges after they are responded to. All challenges are owned by the handler itself, and will persist until the handler is deleted.

    void handleArcGISAuthenticationChallenge(ArcGISAuthenticationChallenge* challenge) override
    {
      credential = // create appropriate credential ...
      challenge->continueWithCredential(credential);
      challenge->deleteLater();
    }

    See also ArcGISCredential::serverContext.

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