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
urlSessionPass the SAPURLSession instance associated with onboarding session.
completionHandlerclosure 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
completionHandlerclosure called on completion. Date provided on success, nil is returned otherwise
-
Sets value of FlowPresentationDelegate
Declaration
Swift
public func set(flowPresentationDelegate: FlowPresentationDelegate)Parameters
flowPresentationDelegateinstance of
FlowPresentationDelegate -
Sets value of authentication type of app
Declaration
Swift
public func set(authenticationType: LogoutHandler.AuthenticationType)Parameters
authenticationTypereturns instance of AuthenticationType
-
Sets value of authentication type of app
Declaration
Swift
public func set(authenticationTypeForBrowser: LogoutHandler.AuthenticationTypeForBrowser)Parameters
authenticationTypeForBrowserreturns instance of authenticationTypeForBrowser
-
Saves instanse of
SAPcpmsSettingsParametersused in logout flowDeclaration
Swift
public func set(settingsParameter: SAPcpmsSettingsParameters)Parameters
settingsParameterThe
SAPcpmsSettingsParameterscontaning the backend URL. -
Saves instanse of
SAPURLSessionused in logout flowDeclaration
Swift
public func set(sapURLSession: SAPURLSession)Parameters
sapURLSessionThe
SAPURLSessionassociated 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)