OAuthClientInfo Class

  • OAuthClientInfo
  • class Esri::ArcGISRuntime::OAuthClientInfo

    Client authentication information obtained from registering an application with a portal or ArcGIS Online. More...

    Header: #include <OAuthClientInfo.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::JsonSerializable

    Public Functions

    OAuthClientInfo()
    OAuthClientInfo(const QString &clientId, Esri::ArcGISRuntime::OAuthMode mode)
    OAuthClientInfo(const QString &clientId, const QString &clientSecret, Esri::ArcGISRuntime::OAuthMode mode)
    OAuthClientInfo(const QString &clientId, const QString &clientSecret, const QString &redirectUri, Esri::ArcGISRuntime::OAuthMode mode)
    OAuthClientInfo(const Esri::ArcGISRuntime::OAuthClientInfo &other)
    OAuthClientInfo(Esri::ArcGISRuntime::OAuthClientInfo &&other)
    virtual ~OAuthClientInfo() override
    void clear()
    QString clientId() const
    QString clientSecret() const
    QString culture() const
    bool isEmpty() const
    Esri::ArcGISRuntime::OAuthMode oAuthMode() const
    QString redirectUri() const
    int refreshTokenExchangeInterval() const
    int refreshTokenExpirationInterval() const
    void setClientId(const QString &clientId)
    void setClientSecret(const QString &clientSecret)
    void setCulture(const QString &culture)
    void setOAuthMode(Esri::ArcGISRuntime::OAuthMode mode)
    void setRedirectUri(const QString &redirectUri)
    void setRefreshTokenExchangeInterval(int refreshTokenExchangeInterval)
    void setRefreshTokenExpirationInterval(int refreshTokenExpirationInterval)
    bool operator!=(const Esri::ArcGISRuntime::OAuthClientInfo &other) const
    Esri::ArcGISRuntime::OAuthClientInfo &operator=(const Esri::ArcGISRuntime::OAuthClientInfo &other)
    Esri::ArcGISRuntime::OAuthClientInfo &operator=(Esri::ArcGISRuntime::OAuthClientInfo &&other)
    bool operator==(const Esri::ArcGISRuntime::OAuthClientInfo &other) const

    Reimplemented Public Functions

    virtual QString toJson() const override
    virtual QJsonObject unknownJson() const override
    virtual QJsonObject unsupportedJson() const override

    Static Public Members

    Esri::ArcGISRuntime::OAuthClientInfo fromJson(const QString &json)

    Detailed Description

    Applications can generate tokens that can access ArcGIS Online content and services using OAuth client information configured for OAuthMode::App.

    This information can also allow ArcGIS Online users to authorize your application to access ArcGIS Online content and services on their behalf by configuring with OAuthMode::User. Usage will be billed to that user and you can access that user's private content.

    Your client secret should never be accessible to users or other developers. Treat it like a password.

    Member Function Documentation

    OAuthClientInfo::OAuthClientInfo()

    Default constructor.

    OAuthClientInfo::OAuthClientInfo(const QString &clientId, Esri::ArcGISRuntime::OAuthMode mode)

    Constructs OAuthClientInfo with a clientId and the OAuth authentication mode.

    OAuthClientInfo::OAuthClientInfo(const QString &clientId, const QString &clientSecret, Esri::ArcGISRuntime::OAuthMode mode)

    Constructs OAuthClientInfo with a clientId, a clientSecret and the OAuth authentication mode.

    The client secret is only required when using OAuthMode::App.

    OAuthClientInfo::OAuthClientInfo(const QString &clientId, const QString &clientSecret, const QString &redirectUri, Esri::ArcGISRuntime::OAuthMode mode)

    Constructs OAuthClientInfo with a clientId, a clientSecret, a redirectUri, and the OAuth authentication mode.

    The client secret is only required when using OAuthMode::App. The redirect URL defaults to urn:ietf:wg:oauth:2.0:oob for the ArcGIS-hosted redirect_uri.

    OAuthClientInfo::OAuthClientInfo(const Esri::ArcGISRuntime::OAuthClientInfo &other)

    Copy constructor from other OAuthClientInfo.

    OAuthClientInfo::OAuthClientInfo(Esri::ArcGISRuntime::OAuthClientInfo &&other)

    Move constructor from other OAuthClientInfo.

    [override virtual] OAuthClientInfo::~OAuthClientInfo()

    Destructor

    void OAuthClientInfo::clear()

    Sets this OAuthClientInfo to empty.

    QString OAuthClientInfo::clientId() const

    Returns the client ID associated with the application.

    See also setClientId().

    QString OAuthClientInfo::clientSecret() const

    Returns the client secret associated with the application.

    See also setClientSecret().

    [since Esri::ArcGISRuntime 100.11] QString OAuthClientInfo::culture() const

    Returns the culture code corresponding to the language to be used on the OAuth login page.

    The default culture code is based on the current culture set on the device/machine. Set it to empty string if you want to see

    The format for the culture code is based on a language code and a country code, separated by a dash. Example: "en-US".

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setCulture().

    [static] Esri::ArcGISRuntime::OAuthClientInfo OAuthClientInfo::fromJson(const QString &json)

    Creates new OAuthClientInfo from json.

    bool OAuthClientInfo::isEmpty() const

    Returns true if this OAuthClientInfo is empty.

    Esri::ArcGISRuntime::OAuthMode OAuthClientInfo::oAuthMode() const

    Returns the OAuthMode used for obtaining an OAuth access token.

    See also setOAuthMode().

    QString OAuthClientInfo::redirectUri() const

    Returns the URL where the access token or authorization code will be delivered upon successful authorization.

    See also setRedirectUri().

    [since Esri::ArcGISRuntime 100.8] int OAuthClientInfo::refreshTokenExchangeInterval() const

    Returns the requested exchange interval (in minutes) for the refreshToken generated by the OAuth request.

    The default value is 1440 minutes (1 day).

    This function was introduced in Esri::ArcGISRuntime 100.8.

    See also setRefreshTokenExchangeInterval().

    [since Esri::ArcGISRuntime 100.6] int OAuthClientInfo::refreshTokenExpirationInterval() const

    Returns the requested expiration interval (in minutes) for the refresh token generated by the OAuth request.

    The max interval can be overridden by the portal administrator. If this is not set, then refreshToken is valid for two weeks. For a permanent refreshToken (if the portal supports it), use -1.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    See also setRefreshTokenExpirationInterval().

    void OAuthClientInfo::setClientId(const QString &clientId)

    Sets the clientId associated with the application.

    See also clientId().

    void OAuthClientInfo::setClientSecret(const QString &clientSecret)

    Sets the clientSecret associated with the application.

    See also clientSecret().

    [since Esri::ArcGISRuntime 100.11] void OAuthClientInfo::setCulture(const QString &culture)

    Sets the culture code corresponding to the language to be used on the OAuth login page.

    The default culture code is based on the current culture set on the device/machine. Set it to empty string if you want to see the OAuth login page in the language corresponding to the culture set in the portal/organization settings.

    The format for the culture code is based on a language code and a country code, separated by a dash. Example: "en-US". If the argument contains an underscrore, the format is fixed to use a dash.

    The list of accepted languages can be requested using the REST API: https://developers.arcgis.com/rest/users-groups-and-items/languages.htm.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also culture().

    void OAuthClientInfo::setOAuthMode(Esri::ArcGISRuntime::OAuthMode mode)

    Sets the OAuth mode to be used for obtaining an OAuth access token.

    See also oAuthMode().

    void OAuthClientInfo::setRedirectUri(const QString &redirectUri)

    Sets the redirectUri where the access token or authorization code will be delivered upon successful authorization.

    The URL must match one of the URLs specified during app registration, otherwise authorization will be rejected.

    See also redirectUri().

    [since Esri::ArcGISRuntime 100.8] void OAuthClientInfo::setRefreshTokenExchangeInterval(int refreshTokenExchangeInterval)

    Sets the refreshTokenExchangeInterval (in minutes) for the refreshToken generated by the OAuth request.

    If refreshTokenExpirationInterval is set to -1 then refreshToken is considered to be permanent. However, the portal/server allows the refreshToken to be valid for maximum 90 days only. In order for it to be permanent, refreshToken token needs to exchanged every n minutes.

    This will be used only when refreshTokenExpirationInterval is set to -1.

    Note: If exchange interval is set 0 or less than 0 then it will be set to default value 1440 minutes (1 day).

    Note: If exchange interval is set more than 129600 minutes (90 days) then it will be clamped to 129600 minutes (90 days).

    Note: It is recommended to keep this interval as low as possible because long lived refresh tokens may increase the security risk.

    This function was introduced in Esri::ArcGISRuntime 100.8.

    See also refreshTokenExchangeInterval().

    [since Esri::ArcGISRuntime 100.6] void OAuthClientInfo::setRefreshTokenExpirationInterval(int refreshTokenExpirationInterval)

    Sets the refreshTokenExpirationInterval (in minutes) for the refresh token generated by the OAuth request. The max interval can be overridden by the portal administrator.

    Note: For a permanent refreshToken (if the portal supports it), use -1.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    See also refreshTokenExpirationInterval().

    [override virtual] QString OAuthClientInfo::toJson() const

    Reimplements: JsonSerializable::toJson() const.

    Returns the OAuthClientInfo as a JSON string representation.

    [override virtual] QJsonObject OAuthClientInfo::unknownJson() const

    Reimplements: JsonSerializable::unknownJson() const.

    Gets the unknown JSON of this object.

    See also JsonSerializable.

    [override virtual] QJsonObject OAuthClientInfo::unsupportedJson() const

    Reimplements: JsonSerializable::unsupportedJson() const.

    Gets the unsupported JSON of this object.

    See also JsonSerializable.

    [since Esri::ArcGISRuntime 200.2] bool OAuthClientInfo::operator!=(const Esri::ArcGISRuntime::OAuthClientInfo &other) const

    Inequality operator. Returns true if this object and other are not equal.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    See also OAuthClientInfo::operator==.

    Esri::ArcGISRuntime::OAuthClientInfo &OAuthClientInfo::operator=(const Esri::ArcGISRuntime::OAuthClientInfo &other)

    Assignment operator from other OAuthClientInfo.

    Esri::ArcGISRuntime::OAuthClientInfo &OAuthClientInfo::operator=(Esri::ArcGISRuntime::OAuthClientInfo &&other)

    Move operator from other OAuthClientInfo.

    bool OAuthClientInfo::operator==(const Esri::ArcGISRuntime::OAuthClientInfo &other) const

    Returns true if this OAuthClientInfo and other are equal.

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