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
handler
the caller class notifying about changes
user
the original user Id
to
the new user Id
-
User authentication failed
Declaration
Swift
func authenticationHandler(_ handler: AuthenticationHandling, user: String?, didFailToAuthenticate error: Error)
Parameters
handler
the caller class notifying about changes
user
the original user id
error
the 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
handler
the caller class notifying about changes
userInfo
the information about the user
completionHandler
completion handler to provide any error with authenticated user info