AuthenticationController

public class AuthenticationController

The AuthenticationController class is responsible for authentication management. This class provides API’s to retrieve the expiration timestamp of access token and refresh token.

  • Undocumented

    Declaration

    Swift

    public static let shared: AuthenticationController
  • Returns the Refresh Token Expiry.

    Declaration

    Swift

    public func getRefreshTokenLifetime(urlSession: SAPURLSession, completion: @escaping (Date?) -> Void)

    Parameters

    urlSession

    Pass the SAPURLSession instance associated with onboarding session.

    completionHandler

    closure called on completion. Date provided on success, nil is returned otherwise

  • Returns the Access Token Expiry.

    Declaration

    Swift

    public func getAccessTokenLifetime(completion: @escaping (Date?) -> Void)

    Parameters

    completionHandler

    closure called on completion. Date provided on success, nil is returned otherwise

  • Sets value of FlowPresentationDelegate

    Declaration

    Swift

    public func set(flowPresentationDelegate: FlowPresentationDelegate)

    Parameters

    flowPresentationDelegate
  • Sets value of authentication type of app

    Declaration

    Swift

    public func set(authenticationType: LogoutHandler.AuthenticationType)

    Parameters

    authenticationType

    returns instance of AuthenticationType

  • Sets value of authentication type of app

    Declaration

    Swift

    public func set(authenticationTypeForBrowser: LogoutHandler.AuthenticationTypeForBrowser)

    Parameters

    authenticationTypeForBrowser

    returns instance of authenticationTypeForBrowser

  • Saves instanse of SAPcpmsSettingsParameters used in logout flow

    Declaration

    Swift

    public func set(settingsParameter: SAPcpmsSettingsParameters)

    Parameters

    settingsParameter

    The SAPcpmsSettingsParameters contaning the backend URL.

  • Saves instanse of SAPURLSession used in logout flow

    Declaration

    Swift

    public func set(sapURLSession: SAPURLSession)

    Parameters

    sapURLSession

    The SAPURLSession associated with Onabording Session

  • Initiates the logout process asynchronously.

    Throws

    An error if parameter validation fails or if the logout process encounters an error.

    Declaration

    Swift

    public func logout(logoutRevokeLevel: LogoutRevokeLevel = .user) async throws
  • Initiates the logout process.

    Throws

    An error if parameter validation fails or if the logout process encounters an error.

    Declaration

    Swift

    public func logout(logoutRevokeLevel: LogoutRevokeLevel = .user, completionHandler: @escaping (Error?) -> Void)