OnlineAuthenticationHandler

open class OnlineAuthenticationHandler: AuthenticationHandler

Base class for all online authentication handlers

Processes online authentication, and allows for authentication refresh capabilities.

  • An AuthenticationHandler for refreshing a prior authentication, usually via a Oauth2 refresh token.

    See also: RefreshAuthenticationHandler

    Declaration

    Swift

    public var refreshAuthenticationHandler: RefreshAuthenticationHandler?
  • The AuthenticationManager controlling this AuthenticationHandler

    Declaration

    Swift

    public override weak var manager: AuthenticationManager?
  • The authentication path used to perform the Oauth2 login process, or for web-based login configurations, the path to the login page.

    Declaration

    Swift

    public var loginURLPath = ""
  • The authentication path used to log the user out and remove the current user session.

    Declaration

    Swift

    public var logoutURLPath = PredixMobilityConfiguration.logoutURLPath
  • Convenience reference to manager’s configuration clientId value. Equal to self.manager?.configuration.clientId

    Declaration

    Swift

    public var clientId: String?
  • Convenience reference to manager’s configuration clientSecret value. Equal to self.manager?.configuration.clientSecret

    Declaration

    Swift

    public var clientSecret: String?
  • Method used when calling logoutURLPath during the logout method

    Declaration

    Swift

    public var logoutMethod = "POST"
  • Initializes and returns an OnlineAuthenticationHandler object

    Declaration

    Swift

    public override init()
  • Starts the authentication process.

    Called by the associated AuthenticationManager when needed.

    If a RefreshAuthenticationHandler is associated with this OnlineAuthenticationHandler the refresh handler may be invoked to handle this authentication.

    Declaration

    Swift

    override public func authenticate(completionHandler: @escaping (_ result: AuthenticateResult) -> Void)

    Parameters

    completionHandler

    closure called when authentication has completed.

    result

    AuthenticateResult: Success or fail, result of authentication.

  • Declaration

    Swift

    override open func logout(completionHandler: @escaping () -> Void)
  • Should not be called from external consumers. The authenticate method should be used to start the authentication process.

    Subclasses should override this method to perform the actual work of authentication, and should call authenticationComplete(status:) with the result of that authentication.

    Declaration

    Swift

    open func performOnlineAuthentication()