AuthenticationManagerConfiguration

public struct AuthenticationManagerConfiguration

Configuration for Authentication

  • Initialization:

    AuthenticationManagerConfiguration will attempt to read oAuth client id and client secret values from the Info.plist using the keys client_id and client_secret

    Declaration

    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.serverEndpointURL

  • Declaration

    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

    serverEndpoint

    the Predix Mobile endpoint as a String.

  • The base authentication server URL to use for online authentication. This URL will be combined with the paths loginURLPath and logoutURLPath

    For example:

    If the baseURL is a URL pointing to: https://mybackend.predix.io/ and loginURLPath is set to /auth/login then when the user logs in, a call will be made to: https://mybackend.predix.io/auth/login to 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_id key in Info.plist, or nil if no such key/value pair exists

    Declaration

    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_secret key in Info.plist, or nil if no such key/value pair exists

    Declaration

    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 baseURL and 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