TokenProvider
@objc
public protocol TokenProvider
TokenProvider protocol.
Conform to the TokenProvider protocol in order to generate the token for the user that you want to authenticate.
-
Method
fetchToken
will return the token on success or error on failure.Precondition
userId
should not be nil.Declaration
Swift
func fetchToken(userId: String, completionHandler completion: @escaping (String, Error?) -> Void) throws
Parameters
userId
Id of the user that you want to generate the token for.
completion
The block to execute when operation succeeds or fails.