Skip to content

OAuthUserCredential Class

  • OAuthUserCredential
  • class Esri::ArcGISRuntime::Authentication::OAuthUserCredential

    A credential for accessing OAuth token secured ArcGIS resources. More...

    Header: #include <Authentication/OAuthUserCredential.h>
    Since: Esri::ArcGISRuntime 200.8
    Inherits: Esri::ArcGISRuntime::Authentication::ArcGISCredential

    Public Functions

    virtual ~OAuthUserCredential() override
    QString authorizationCode() const
    Esri::ArcGISRuntime::Authentication::OAuthUserConfiguration *configuration() const
    QFuture<void> revokeTokenAsync()
    QFuture<Esri::ArcGISRuntime::Authentication::OAuthUserTokenInfo *> tokenInfoAsync(QObject *parent = nullptr)

    Static Public Members

    QFuture<Esri::ArcGISRuntime::Authentication::OAuthUserCredential *> createAsync(Esri::ArcGISRuntime::Authentication::OAuthUserConfiguration *configuration, QObject *parent = nullptr)

    Detailed Description

    Member Function Documentation

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

    Destructor.

    QString OAuthUserCredential::authorizationCode() const

    Returns an authorization code to generate the OAuth token.

    Esri::ArcGISRuntime::Authentication::OAuthUserConfiguration *OAuthUserCredential::configuration() const

    Returns the OAuth configuration details of an application that can sign into an ArcGIS Online or ArcGIS Enterprise portal using OAuth.

    See also Register Your Application.

    [static] QFuture<Esri::ArcGISRuntime::Authentication::OAuthUserCredential *> OAuthUserCredential::createAsync(Esri::ArcGISRuntime::Authentication::OAuthUserConfiguration *configuration, QObject *parent = nullptr)

    Creates an OAuthUserCredential with information needed to access an ArcGIS resource. This initiates the OAuth login process by presenting the OAuth login page.

    • configuration - The OAuth configuration details of an application that can sign into an ArcGIS Online or ArcGIS Enterprise portal using OAuth.
    • parent - An optional parent.

    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.

    QFuture<void> OAuthUserCredential::revokeTokenAsync()

    Sends a network request to revoke OAuth refresh and access tokens.

    This call will fail if the tokens have not been successfully revoked.

    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.

    QFuture<Esri::ArcGISRuntime::Authentication::OAuthUserTokenInfo *> OAuthUserCredential::tokenInfoAsync(QObject *parent = nullptr)

    Returns an instance of OAuthUserTokenInfo generated by this credential, with an optional parent.

    If the access token has expired, this method regenerates it. If the OAuthUserConfiguration::refreshTokenExchangeInterval is set, this method exchanges the refresh token at specified interval. While regenerating the access token or exchanging the refresh token, if the refresh token is expired, an invalid token error is returned.

    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.

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