public interface StitchAuth
StitchCredential
s, retrieving the current
user, and getting authentication provider clients to perform actions such as registering users
and creating user API keys.Modifier and Type | Method and Description |
---|---|
<ClientT> ClientT |
getProviderClient(AuthProviderClientFactory<ClientT> factory)
Gets a client for the given authentication provider.
|
<T> T |
getProviderClient(NamedAuthProviderClientFactory<T> factory,
String providerName)
Gets a client for the given named authentication provider.
|
StitchUser |
getUser()
Returns the currently logged in user; null if not logged in.
|
boolean |
isLoggedIn()
Returns whether or not there's a currently logged in user.
|
StitchUser |
loginWithCredential(StitchCredential credential)
Logs a user in with the given credentials associated with an authentication provider created
from
getProviderClient(AuthProviderClientFactory) or getProviderClient(NamedAuthProviderClientFactory, String) . |
void |
logout()
Logs out the currently logged in user.
|
<ClientT> ClientT getProviderClient(AuthProviderClientFactory<ClientT> factory)
ClientT
- The type of client to be returned by the factory.factory
- The factory that will create a client for the authentication provider.<T> T getProviderClient(NamedAuthProviderClientFactory<T> factory, String providerName)
T
- the type of client to be returned by the factory.factory
- the factory that will create a client for the authentication provider.providerName
- the name of the authentication provider.StitchUser loginWithCredential(StitchCredential credential)
getProviderClient(AuthProviderClientFactory)
or getProviderClient(NamedAuthProviderClientFactory, String)
.credential
- the credentials of the user to log in.void logout()
boolean isLoggedIn()
@Nullable StitchUser getUser()