DXLoginDelegate

Protocol that defines various authentication lifecycle methods.

@objc public protocol DXLoginDelegate: class

This protocol is available to provide conforming classes information during authentication lifecycle methods. An instance of a conforming class can be passed to the isAuthenticated method in the DXAuthClient class. While all the methods in the protocol are optional, as well as passing an instance to the isAuthenticated method, it's recommended that you provide a class implementing the methods, as it will provide you with valuable information that can occur during the authentication lifecycle (such as a failed login or logout). It's also important to respond to these events gracefully, such as presenting the login screen after a logout (whether or not the logout occurred with an error).

Methods

didFailToLogin

@objc optional func didFailToLogin(with error: Error) -> Void

This method will be invoked if an error occurs during the SSO flow, e.g., an inability to extract authentication tokens from a redirect URI.

Parameter

Type

Description

with

Error

The Error instance that occurred during the login flow.

didLogout

@objc optional func didLogout(with error: Error) -> Void

This method will be invoked if an error occurs during logout.

Parameter

Type

Description

with

Error

The Error instance that occurred during logout.

didLogoutSuccessfully

@objc optional func didLogoutSuccessfully() -> Void

This method will be invoked after a successful logout.

Last updated