OAuthInfo
require(["esri/identity/OAuthInfo"], function(OAuthInfo) { /* code goes here */ });
esri/identity/OAuthInfo
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 Objectoptional
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
Name | Type | Summary | Class | |
---|---|---|---|---|
String | The registered application id. more details | more details | OAuthInfo | |
String | Applications with the same value will share the stored token on the same host. more details | more details | OAuthInfo | |
String | The name of the class. more details | more details | Accessor | |
Number | The number of minutes that the token is valid. more details | more details | OAuthInfo | |
String | The locale for the OAuth sign in page. more details | more details | OAuthInfo | |
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 | OAuthInfo | |
Boolean | Set to | more details | OAuthInfo | |
String | Applicable if working with the popup user-login workflow. more details | more details | OAuthInfo | |
String | The window features passed to window.open(). more details | more details | OAuthInfo | |
String | The ArcGIS Enterprise portal URL. more details | more details | OAuthInfo |
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)
- 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
- popupBoolean
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
Name | Return Type | Summary | Class | |
---|---|---|---|---|
OAuthInfo | Creates a copy of the OAuthInfo object. more details | more details | OAuthInfo | |
* | 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 | OAuthInfo | |
Object | Converts an instance of this class to its ArcGIS portal JSON representation. more details | more details | OAuthInfo |
Method Details
- clone(){OAuthInfo}Since: ArcGIS API for JavaScript 4.4
Creates 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.