ArcGIS Runtime SDK for iOS: AGSOAuthConfiguration Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSOAuthConfiguration Class Reference

Description

OAuth details of an app.

Instances of this class contain the OAuth configuration details of an app that can sign into an ArcGIS Portal or ArcGIS Online using OAuth.

Since
100
Inheritance diagram for AGSOAuthConfiguration:

Instance Methods

(UIUserInterfaceStyle userInterfaceStyle) - API_AVAILABLE
 
(instancetype) - initWithPortalURL:clientID:redirectURL:
 

Class Methods

(instancetype) + OAuthConfigurationWithPortalURL:clientID:redirectURL:
 

Properties

NSString * clientID
 
NSLocale * locale
 
NSURL * portalURL
 
BOOL prefersEphemeralWebBrowserSession
 
NSString * redirectURL
 
NSInteger refreshTokenExchangeInterval
 
NSInteger refreshTokenExpirationInterval
 
BOOL showCancelButton
 
BOOL showSocialLogins
 

Method Documentation

◆ API_AVAILABLE

- (UIUserInterfaceStyle userInterfaceStyle) API_AVAILABLE (ios(12.0)) 

Constants indicating the interface style for the OAuth login page. UIUserInterfaceStyleUnspecified - The system's interface style. UIUserInterfaceStyleLight - The light interface style. UIUserInterfaceStyleDark - The dark interface style.

Note
The default is UIUserInterfaceStyleUnspecified
Since
100.7

◆ initWithPortalURL:clientID:redirectURL:

- (instancetype) initWithPortalURL: (nullable NSURL *)  portalURL
clientID: (NSString *)  clientID
redirectURL: (nullable NSString *)  redirectURL 

Initialize the OAuth configuration with provided parameters

Parameters
portalURLThe URL of the portal to authenticate with. This can be nil if you want to use the provided clientID and/or redirectURL for all portals
clientIDUnique ID with which this application was registered with the portal.
redirectURLThe URL that the OAuth login page will redirect to when authentication completes. For example, myapp://oauth/. This URL must be registered with the portal when generating the clientID, and this application must declare that it can handle the URL.
Since
100
See also
- application:openURL:options: (AGSApplicationDelegate) if you are setting the redirectURL.

◆ OAuthConfigurationWithPortalURL:clientID:redirectURL:

+ (instancetype) OAuthConfigurationWithPortalURL: (nullable NSURL *)  portalURL
clientID: (NSString *)  clientID
redirectURL: (nullable NSString *)  redirectURL 

Initialize the OAuth configuration with provided parameters

Parameters
portalURLThe URL of the portal to authenticate with. This can be nil if you want to use the provided clientID and/or redirectURL for all portals
clientIDUnique ID with which this application was registered with the portal.
redirectURLThe URL that the OAuth login page will redirect to when authentication completes. For example, myapp://oauth/. This URL must be registered with the portal when generating the clientID, and this application must declare that it can handle the URL.
Since
100
See also
- application:openURL:options: (AGSApplicationDelegate) if you are setting the redirectURL.

Property Documentation

◆ clientID

- (NSString*) clientID
readnonatomiccopy

Unquie ID with which this application was registered with the portal.

Since
100

◆ locale

- (NSLocale*) locale
readwritenonatomicstrong

The OAuth login page will display in the language specified by the given locale. If not explicitly set, NSLocale.currentLocale is used. If the given locale is not supported by the portal or set to nil, OAuth login page will display in the language corresponding to locale set in the portal/organization settings.

Since
100.9

◆ portalURL

- (NSURL*) portalURL
readnonatomicstrong

The URL of the portal to authenticate with. For example, https://www.arcgis.com

Since
100

◆ prefersEphemeralWebBrowserSession

- (BOOL) prefersEphemeralWebBrowserSession
readwritenonatomicassign

A Boolean value that indicates whether the session should ask the browser for a private authentication session.

The default is NO.

Since
100.12

◆ redirectURL

- (NSString*) redirectURL
readnonatomiccopy

The URL that the OAuth login page will redirect to when authentication completes. For example, myapp://oauth/. The URL must be registered with the portal when generating the clientID, and this application must declare that it can handle the URL.

Since
100

◆ refreshTokenExchangeInterval

- (NSInteger) refreshTokenExchangeInterval
readwritenonatomicassign

The requested exchange interval (in minutes) for the refreshToken generated by the OAuth request. If AGSOAuthConfiguration::refreshTokenExpirationInterval is set to -1 then refreshToken is considered to be permanent. However, the portal/server allows the refreshToken to be valid for maximum 90 days only. In order for it to be permanent, refreshToken needs to exchanged every n minutes. This property will be used only when AGSOAuthConfiguration::refreshTokenExpirationInterval is set to -1.

Note
The default value is 1440 minutes (1 day).
  • If exchange interval is set 0 or less than 0 then it will be set to default value 1440 minutes (1 day).
  • If exchange interval is set more than 129600 minutes (90 days) then it will be clamped to 129600 minutes (90 days).
  • It is recommended to keep this interval as low as possible because long lived refresh tokens may increase the security risk.
Since
100.7

◆ refreshTokenExpirationInterval

- (NSInteger) refreshTokenExpirationInterval
readwritenonatomicassign

The requested expiration interval (in minutes) for the refreshToken generated by the OAuth request. The max interval can be overridden by the portal administrator.

Note
If this is not set, then refreshToken is valid for two weeks. For a permanent refreshToken (if the portal supports it), use -1.
See also
AGSOAuthConfiguration::refreshTokenExchangeInterval
Since
100

◆ showCancelButton

- (BOOL) showCancelButton
readwritenonatomicassign

Defaults to YES. A "Cancel" button will be displayed next to "Sign In" on the OAuth web page. When clicked, the completion handler will be called with an NSUserCancelledError. If you want to hide the button then set to NO.

Since
100

◆ showSocialLogins

- (BOOL) showSocialLogins
readwritenonatomicassign

Defaults to NO. When set to YES, options to use social logins (Facebook and Google+) will be displayed on the OAuth login page.

Since
100
Deprecated:
100.2. There is no impact of setting this property. The setting is available on portal/organization which can be set by the Administrator.