require(["esri/identity/OAuthInfo"], function(OAuthInfo) { /* code goes here */ });
Class: esri/identity/OAuthInfo
Inheritance: OAuthInfo Accessor
Since: ArcGIS API for JavaScript 4.0

This class contains information about an OAuth 2.0 configuration. Use it in combination with the IdentityManager widget to aid in working with OAuth 2.0 authentication.

See also:

Constructors

new OAuthInfo(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Example:
require(["esri/identity/OAuthInfo", "esri/identity/IdentityManager"],
function (OAuthInfo, esriId)
{
  var info = new OAuthInfo({
    appId: "<put client id here>",
    popup: true
  });

  esriId.registerOAuthInfos([info]);
})

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
String

The registered application id.

more details
more detailsOAuthInfo
String

Applications with the same value will share the stored token on the same host.

more details
more detailsOAuthInfo
String

The name of the class.

more details
more detailsAccessor
Number

The number of minutes that the token is valid.

more details
more detailsOAuthInfo
String

The locale for the OAuth sign in page.

more details
more detailsOAuthInfo
Number

The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use.

more details
more detailsOAuthInfo
Boolean

Set to true to show the OAuth sign in page in a popup window.

more details
more detailsOAuthInfo
String

Applicable if working with the popup user-login workflow.

more details
more detailsOAuthInfo
String

The window features passed to window.open().

more details
more detailsOAuthInfo
String

The ArcGIS Enterprise portal URL.

more details
more detailsOAuthInfo

Property Details

appIdString

The registered application id.

authNamespaceString

Applications with the same value will share the stored token on the same host.

Default Value:/ (forward slash)
declaredClassStringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

expirationNumber

The number of minutes that the token is valid.

Default Value:20160 (two weeks)
localeString

The locale for the OAuth sign in page. The default locale is based on your browser/OS and the organization locale. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com.

Default Value:Based on your browser/OS and the organization locale.
minTimeUntilExpirationNumber

The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use.

Default Value:30

Set to true to show the OAuth sign in page in a popup window.

Default Value:false
popupCallbackUrlString

Applicable if working with the popup user-login workflow. This is a relative page URL that redirects the user back to the secured application after successful login.

Default Value:"oauth-callback.html"
See also:
popupWindowFeaturesString

The window features passed to window.open().

Default Value:height=490,width=800,resizable,scrollbars,status
portalUrlString

The ArcGIS Enterprise portal URL.

Default Value:"https://www.arcgis.com"

Method Overview

NameReturn TypeSummaryClass
OAuthInfo

Creates a copy of the OAuthInfo object.

more details
more detailsOAuthInfo
*

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform.

more details
more detailsOAuthInfo
Object

Converts an instance of this class to its ArcGIS portal JSON representation.

more details
more detailsOAuthInfo

Method Details

clone(){OAuthInfo}
Since: ArcGIS API for JavaScript 4.4

Creates a copy of the OAuthInfo object.

Returns:
TypeDescription
OAuthInfoReturns a copy of the OAuthInfo.
fromJSON(json){*}static

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameter:
json Object

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns:
TypeDescription
*Returns a new instance of this class.
toJSON(){Object}

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.

Returns:
TypeDescription
ObjectThe ArcGIS portal JSON representation of an instance of this class.

API Reference search results

NameTypeModule
Loading...