AuthenticationDelegate
public protocol AuthenticationDelegate : AnyObject
Implementers will be notified when the authenticated user changes during runtime if a new authentication is forced by the server and the user authenticates with credentials ends up on a different user Id
-
User authenticated with a different user
Declaration
Swift
func authenticationHandler(_ handler: AuthenticationHandling, user: String, didChange to: String)Parameters
handlerthe caller class notifying about changes
userthe original user Id
tothe new user Id
-
User authentication failed
Declaration
Swift
func authenticationHandler(_ handler: AuthenticationHandling, user: String?, didFailToAuthenticate error: Error)Parameters
handlerthe caller class notifying about changes
userthe original user id
errorthe error the authentication failed with
-
authenticationHandler(_:didAuthenticate:completionHandler:)Default implementationUser authentication is successful
Default Implementation
Declaration
Swift
func authenticationHandler(_ handler: AuthenticationHandling, didAuthenticate userInfo: SAPcpmsUserRoles.SAPcpmsUserInfo, completionHandler: @escaping (Error?) -> Void)Parameters
handlerthe caller class notifying about changes
userInfothe information about the user
completionHandlercompletion handler to provide any error with authenticated user info