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.
Constructors
new OAuthInfo(properties)
properties Object See the properties for a list of all the properties that may be passed into the constructor. |
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
Name | Type | Summary | |
---|---|---|---|
String | The registered application id. more details | more details | |
String | Applications with the same value will share the stored token on the same host. more details | more details | |
String | The name of the class. more details | more details | |
Number | The number of minutes that the token is valid. more details | more details | |
String | The locale for the OAuth sign in page. more details | more details | |
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 details | |
Boolean | Set to | more details | |
String | Applicable if working with the popup user-login workflow. more details | more details | |
String | The window features passed to window.open(). more details | more details | |
String | The ArcGIS for Portal URL. more details | more details |
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
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: 30popupBoolean
Set to
true
to show the OAuth sign in page in a popup window.Default Value: falsepopupCallbackUrlString
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.
- See also:
Default Value: "oath-callback.html"popupWindowFeaturesString
The window features passed to window.open().
Default Value: height=480,width=800,location,resizable,scrollbars,statusportalUrlString
The ArcGIS for Portal URL.
Default Value: "https://www.arcgis.com"
Method Overview
Name | Return Type | Summary | |
---|---|---|---|
OAuthInfo | Creates a copy of the OAuthInfo object. more details | more details | |
* | 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 details | |
Object | Converts an instance of this class to its ArcGIS Portal JSON representation. more details | more details |
Method Details
clone(){OAuthInfo}
Since: ArcGIS API for JavaScript 4.4Creates a copy of the OAuthInfo object.
Returns:Type Description OAuthInfo Returns 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 ObjectA 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:Type Description * 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:Type Description Object The ArcGIS Portal JSON representation of an instance of this class.