StitchUser
public protocol StitchUser : CoreStitchUser
A set of methods and properties that represent a user that a StitchAppClient
is currently authenticated as.
Can be retrieved from a StitchAuth
or from the StitchResult
of certain methods.
-
The String representation of the ID of this Stitch user.
Declaration
Swift
var id: String { get }
-
The type of authentication provider used to log in as this user.
Declaration
Swift
var loggedInProviderType: StitchProviderType { get }
-
The name of the authentication provider used to log in as this user.
Declaration
Swift
var loggedInProviderName: String { get }
-
A string describing the type of this user. (Either
server
ornormal
)Declaration
Swift
var userType: String { get }
-
A
StitchUserProfile
object describing this user.Declaration
Swift
var profile: StitchUserProfile { get }
-
An array of
StitchUserIdentity
objects representing the identities linked to this user which can be used to log in as this user.Declaration
Swift
var identities: [StitchUserIdentity] { get }
-
Links this
StitchUser
with a new identity, where the identity is defined by the credential specified as a parameter. This will only be successful if thisStitchUser
is the currently authenticatedStitchUser
for the client from which it was created.Declaration
Swift
func link(withCredential credential: StitchCredential, _ completionHandler: @escaping (StitchResult<StitchUser>) -> Void)
Parameters
withCredential
The
StitchCore.StitchCredential
used to link the user to a new identity. Credentials can be retrieved from an authentication provider client, which is retrieved using thegetProviderClient
method onStitchAuth
.completionHandler
The completion handler to call when the linking is complete. This handler is executed on a non-main global
DispatchQueue
. If the operation is successful, the result will contain aStitchUser
object representing the currently logged in user.