Package net.gini.android.authorization
Class AnonymousSessionManager
- java.lang.Object
-
- net.gini.android.authorization.AnonymousSessionManager
-
- All Implemented Interfaces:
SessionManager
public class AnonymousSessionManager extends java.lang.Object implements SessionManager
The AnonymousSessionManager is a SessionManager implementation that uses anonymous Gini users.
-
-
Constructor Summary
Constructors Constructor Description AnonymousSessionManager(java.lang.String emailDomain, UserCenterManager userCenterManager, CredentialsStore credentialsStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected bolts.Task<UserCredentials>
createUser()
Creates a new user via the UserCenterManager.bolts.Task<Session>
getSession()
bolts.Task<Session>
loginUser()
Log in the user whose credentials are currently stored in the credentials store.
-
-
-
Constructor Detail
-
AnonymousSessionManager
public AnonymousSessionManager(java.lang.String emailDomain, UserCenterManager userCenterManager, CredentialsStore credentialsStore)
-
-
Method Detail
-
getSession
public bolts.Task<Session> getSession()
- Specified by:
getSession
in interfaceSessionManager
-
loginUser
public bolts.Task<Session> loginUser()
Log in the user whose credentials are currently stored in the credentials store. If there are no stored user credentials, this method will create a new user via the UserCenterManager and then log in the newly created user. If the email domain is different in the existing user credentials from the one that was provided for this instance, a new email with the new domain will be generated and the old email will be replaced.- Returns:
- A task which will resolve to valid Session instance.
-
createUser
protected bolts.Task<UserCredentials> createUser()
Creates a new user via the UserCenterManager. The user credentials of the freshly created user are then stored in the credentials store.Warning: This method overwrites the credentials of an existing user.
- Returns:
- A task which will resolve to a UserCredentials instance which store the credentials of the freshly created user.
-
-