require(["esri/arcgis/OAuthInfo"], function(OAuthInfo) { /* code goes here */ });
Description
(Added at v3.10)
This class contains information about an OAuth configuration.
See also
Samples
Search for
samples that use this class.
Constructors
Properties
Methods
toJson() | Object | Returns an easily serializable object representation of the OAuthInfo. |
Constructor Details
Creates a new OAuthInfo given the specified parameters.
Parameters:
<Object > params |
Required |
Various options to configure the OAuthInfo object. All the properties can be passed into the params object. |
params
properties:
<String > appId |
Required |
The registered application Id. |
<String > authNamespace |
Optional |
Applications with the same value will share the stored token on the same host. The default value is "/" (forward slash). |
<Number > expiration |
Optional |
The number of minutes the token will be valid for. The default is 20160 (two weeks). |
<String > locale |
Optional |
The locale for the OAuth sign in page. The default locale is based on your browser/OS and the locale for the organization that you are using. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. See localization for details. |
<Number > minTimeUntilExpiration |
Optional |
The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use. The default value is 30. |
<Boolean > popup |
Optional |
Set to true to show the OAuth sign in page in a popup window. The default value is "false". |
<String > popupCallbackUrl |
Optional |
The relative page URL for the user to be sent to from the OAuth sign in page. The default value is oauth-callback.html. You can download this here. |
<String > popupWindowFeatures |
Optional |
The window features passed to window.open(). The default value is "height=490,width=800,resizable,scrollbars,status. |
<String > portalUrl |
Optional |
The ArcGIS for Portal URL. The default value is "https://www.arcgis.com." |
Sample: require([
"esri/arcgis/OAuthInfo", ...
], function(OAuthInfo, ... ) {
var oAuthInfo = new OAuthInfo({
appId: "", //required parameter
... //specify optional parameters if needed
});
Property Details
The registered application Id.
Applications with the same value will share the stored token on the same host.
Default value: / (forward slash)
The number of minutes the token that the token is valid.
Default value: 20160 (two weeks).
The locale for the OAuth sign in page. The default locale is based on your browser/OS and the locale for the organization that you are using. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. See
localization for details.
Default value: Based on your browser/OS and the locale for the organization that you are using.
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 minutes
Set to true to show the OAuth sign in page in a popup window.
Known values: true | false
Default value: false
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. You can download the default page
here.
The window features passed to window.open().
Default value: height=490,width=800,resizable,scrollbars,status
The ArcGIS for Portal URL.
Default value: https://www.arcgis.com
Method Details
Returns an easily serializable object representation of the OAuthInfo.