Skip To Content ArcGIS for Developers Sign In Dashboard

OAuthClientInfo Class

class Esri::ArcGISRuntime::OAuthClientInfo

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

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

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

OAuthClientInfo(Esri::ArcGISRuntime::OAuthClientInfo &&other)
OAuthClientInfo(const Esri::ArcGISRuntime::OAuthClientInfo &other)
OAuthClientInfo(const QString &clientId, const QString &clientSecret, const QString &redirectUri, Esri::ArcGISRuntime::OAuthMode mode)
OAuthClientInfo(const QString &clientId, const QString &clientSecret, Esri::ArcGISRuntime::OAuthMode mode)
OAuthClientInfo(const QString &clientId, Esri::ArcGISRuntime::OAuthMode mode)
OAuthClientInfo()
Esri::ArcGISRuntime::OAuthClientInfo &operator=(Esri::ArcGISRuntime::OAuthClientInfo &&other)
Esri::ArcGISRuntime::OAuthClientInfo &operator=(const Esri::ArcGISRuntime::OAuthClientInfo &other)
virtual ~OAuthClientInfo() override
void clear()
QString clientId() const
QString clientSecret() 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 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

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(Esri::ArcGISRuntime::OAuthClientInfo &&other)

Move constructor from other OAuthClientInfo.

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

Copy constructor from other OAuthClientInfo.

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 URI defaults to urn:ietf:wg:oauth:2.0:oob for the ArcGIS-hosted redirect_uri.

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, Esri::ArcGISRuntime::OAuthMode mode)

Constructs OAuthClientInfo with a clientId and the OAuth authentication mode.

OAuthClientInfo::OAuthClientInfo()

Default constructor.

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

Move operator from other OAuthClientInfo.

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

Assignment operator 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().

[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 URI where the access token or authorization code will be delivered upon successful authorization.

See also setRedirectUri().

int OAuthClientInfo::refreshTokenExchangeInterval() const

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

This function was introduced in Esri::ArcGISRuntime 100.8.

See also setRefreshTokenExchangeInterval().

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().

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 URI must match one of the URIs specified during app registration, otherwise authorization will be rejected.

See also redirectUri().

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().

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.

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

Returns true if this OAuthClientInfo and other are equal.


Feedback on this topic?