IdentityProvider
public protocol IdentityProvider : AnyObject
Encapsulates interface requirements for an external identity provider to register and authenticate an identity within Sudo platform ecosystem.
-
register(uid:
Asynchronousparameters: ) Registers a new identity (user) against the identity provider.
Declaration
Swift
func register( uid: String, parameters: [String: String] ) async throws -> String
Parameters
uid
ID of the identity (user).
parameters
The registration parameters.
Return Value
User ID of the newly registered user.
-
deregister(uid:
AsynchronousaccessToken: ) Deregisters an identity (user) from the identity provider.
Declaration
Swift
func deregister( uid: String, accessToken: String ) async throws -> String
Parameters
uid
ID of the identity (user).
accessToken
Access token used to authenticate and authorize the request.
Return Value
User ID of the deregistered user.
-
signIn(uid:
Asynchronousparameters: ) Sign into the identity provider.
Declaration
Swift
func signIn( uid: String, parameters: [String: Any] ) async throws -> AuthenticationTokens
Parameters
uid
ID of the identity (user) to sign in.
parameters
Sign in parameters.
Return Value
Authentication tokens.
-
refreshTokens(refreshToken:
Asynchronous) Refresh the access and ID tokens using the refresh token.
Declaration
Swift
func refreshTokens( refreshToken: String ) async throws -> AuthenticationTokens
Parameters
refreshToken
Refresh token.
Return Value
Authentication tokens.
-
signOut(refreshToken:
Asynchronous) Signs out the user from this device only.
Declaration
Swift
func signOut(refreshToken: String) async throws
-
globalSignOut(accessToken:
Asynchronous) Signs out the user from all devices.
Declaration
Swift
func globalSignOut( accessToken: String ) async throws
Parameters
accessToken
Access token used to authorize the request.