AuthenticationManagerConfiguration
public struct AuthenticationManagerConfiguration
Configuration for Authentication
-
Initialization:
AuthenticationManagerConfigurationwill attempt to read oAuth client id and client secret values from the Info.plist using the keysclient_idandclient_secretDeclaration
Swift
public init() -
Helper function that takes a Predix Mobile service endpoint URL, and retrieves the authentication endpoint configured for that service instance.
Important
This method may make a blocking network request, caution should be used if calling from the main queue.
serverEndpoint: the Predix Mobile endpoint URL. See:
PredixMobilityConfiguration.serverEndpointURLDeclaration
Swift
static public func fetchAuthenticationBaseURL(serverEndpointURL serverUrl: URL) -> URL? -
Helper function that takes a Predix Mobile service endpoint URL, and retrieves the authentication endpoint configured for that service instance.
Important
This method may make a blocking network request, caution should be used if calling from the main queue.
Declaration
Swift
static public func fetchAuthenticationBaseURL(serverEndpoint: String) -> URL?Parameters
serverEndpointthe Predix Mobile endpoint as a String.
-
The base authentication server URL to use for online authentication. This URL will be combined with the paths
loginURLPathandlogoutURLPathFor example:
If the
baseURLis a URL pointing to:https://mybackend.predix.io/andloginURLPathis set to/auth/loginthen when the user logs in, a call will be made to:https://mybackend.predix.io/auth/loginto perform the server-side login process.Declaration
Swift
public var baseURL: URL? -
Specifies Touch ID to be used for authentication refresh, if available, on the device.
If true, and a user has successfully authenticated previously, Touch ID will be used to refresh the user’s authenticated session and for offline authentication.
default: false
Declaration
Swift
public var useTouchID = false -
Client ID value to use for online authentication. A client ID is a public identifier for the authentication server to identify the App
default: Value loaded from
client_idkey in Info.plist, or nil if no such key/value pair existsDeclaration
Swift
public var clientId: String? -
Client secret value to use for online authentication. A client secret should be known only to the application and the authentication server
default: Value loaded from
client_secretkey in Info.plist, or nil if no such key/value pair existsDeclaration
Swift
public var clientSecret: String? -
If true, then in the event of a failure during online authentication, the system will attempt offline authentication.
The fallback to offline only occurs if the online authentication responds with a Fail. Canceled or Denied do not fallback.
default: true
Declaration
Swift
public var allowOnlineFailureFallbackToOffline = true -
Allows the authentication manager to set a UAA Authentication token as the global token to use for Predix versions of NSURLSession.
Setting a token as the authentication token for PredixURLSessions allows URLSessions created with the predix prefix to automaticlly populate the Authentication header with the token recieved during a successful authentication.
default true
Declaration
Swift
public var allowAuthenticationTokenForPredixURLSessions = true
-
Calculates a URL based on the configured
baseURLand the provided path.Declaration
Swift
public func urlWith(path: String) -> URL?
-
Declaration
Swift
public static func == (lhs: AuthenticationManagerConfiguration, rhs: AuthenticationManagerConfiguration) -> Bool
-
Declaration
Swift
public var hashValue: Int
View on GitHub
AuthenticationManagerConfiguration Structure Reference