Skip To Content ArcGIS for Developers Sign In Dashboard

OAuthClientInfo 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: JsonSerializable

Public Functions

OAuthClientInfo()
OAuthClientInfo(const QString &clientId, OAuthMode mode)
OAuthClientInfo(const QString &clientId, const QString &clientSecret, OAuthMode mode)
OAuthClientInfo(const QString &clientId, const QString &clientSecret, const QString &redirectUri, OAuthMode mode)
OAuthClientInfo(const OAuthClientInfo &other)
OAuthClientInfo(OAuthClientInfo &&other)
~OAuthClientInfo()
void clear()
QString clientId() const
QString clientSecret() const
bool isEmpty() const
OAuthMode oAuthMode() const
QString redirectUri() const
int refreshTokenExpirationInterval() const
void setClientId(const QString &clientId)
void setClientSecret(const QString &clientSecret)
void setOAuthMode(OAuthMode mode)
void setRedirectUri(const QString &redirectUri)
void setRefreshTokenExpirationInterval(int refreshTokenExpirationInterval)
OAuthClientInfo &operator=(const OAuthClientInfo &other)
OAuthClientInfo &operator=(OAuthClientInfo &&other)
bool operator==(const OAuthClientInfo &other) const

Reimplemented Public Functions

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

Static Public Members

OAuthClientInfo fromJson(const QString &json)

Detailed Description

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

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

Constructs OAuthClientInfo with a clientId and the OAuth authentication mode.

OAuthClientInfo::OAuthClientInfo(const QString &clientId, const QString &clientSecret, 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, 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 OAuthClientInfo &other)

Copy constructor from other OAuthClientInfo.

OAuthClientInfo::OAuthClientInfo(OAuthClientInfo &&other)

Move constructor from other OAuthClientInfo.

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] OAuthClientInfo OAuthClientInfo::fromJson(const QString &json)

Creates new OAuthClientInfo from json.

bool OAuthClientInfo::isEmpty() const

Returns true if this OAuthClientInfo is empty.

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::refreshTokenExpirationInterval() const

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

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

[virtual] QString OAuthClientInfo::toJson() const

Reimplemented from JsonSerializable::toJson().

Returns the OAuthClientInfo as a JSON string representation.

[virtual] QJsonObject OAuthClientInfo::unknownJson() const

Reimplemented from JsonSerializable::unknownJson().

Gets the unknown JSON of this object.

See also JsonSerializable.

[virtual] QJsonObject OAuthClientInfo::unsupportedJson() const

Reimplemented from JsonSerializable::unsupportedJson().

Gets the unsupported JSON of this object.

See also JsonSerializable.

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

Assignment operator from other OAuthClientInfo.

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

Move operator from other OAuthClientInfo.

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

Returns true if this OAuthClientInfo and other are equal.


Feedback on this topic?