SAPcpmsAuthenticationManager
public class SAPcpmsAuthenticationManager : AuthenticationHandling
The SAPcpmsAuthenticationManager implements the AuthenticationHandling protocol, thus capable of being injected into the adequate authentication observers for result handling. Stores and compares users based on the newly acquired credentials through the SAPcpmsUserRoles component. SAPcpmsAuthenticationManager calls the configured authentication delegates to notify appropriate events. Internal authentication delegate is used internally by the framework and user authentication delegate, invoked subsequently (if present), is the delegate configured by the developer.
-
The user delegate for event notification.
Declaration
Swift
public weak var delegate: AuthenticationDelegate?
-
The role service URL for SAPcpmsUserRoles.
Declaration
Swift
public let roleServiceURL: URL
-
The store used to store the authenticated user’s id.
Declaration
Swift
public let store: CodableStoring
-
The key which under the authenticated user’s id is stored.
Declaration
Swift
public let currentUserIDKey: String
-
Instantiates the class.
Declaration
Swift
public init(roleServiceURL: URL, store: CodableStoring, delegate: AuthenticationDelegate?, internalAuthenticationDelegate: AuthenticationDelegate? = nil)
Parameters
roleServiceURL
The role service URL necessary to create the SAPcpmsUserRoles component.
store
The store used to store the authenticated user’s id.
delegate
The user delegate for event notification.
internalAuthenticationDelegate
The internal delegate for event notification.
-
Instantiates the class.
Declaration
Swift
public convenience init(settingsParameters: SAPcpmsSettingsParameters, store: CodableStoring, delegate: AuthenticationDelegate?, internalAuthenticationDelegate: AuthenticationDelegate? = nil)
Parameters
settingsParameters
The SAPcpmsSettingsParameters necessary to create the SAPcpmsUserRoles component.
store
The store used to store the authenticated user’s id.
delegate
The user delegate for event notification.
internalAuthenticationDelegate
The internal delegate for event notification.
-
Called when an authentication process finished successfully and there is a new token / credential ready to use.
Declaration
Swift
public func authenticationObserver(_ observer: SAPURLSessionObserving, didAuthenticate session: SAPURLSession, requestBypassIdentifier: UUID, completionHandler: @escaping (Error?) -> Void)
-
Called when an authentication process failed.
Declaration
Swift
public func authenticationObserver(_ observer: SAPURLSessionObserving, didFailToAuthenticate session: SAPURLSession, error: Error)