public class AccountManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
AuthResult |
authenticate(AuthRequest who)
Authenticate the user, potentially creating a new account if they are new.
|
AuthResult |
link(Account.Id to,
AuthRequest who)
Link another authentication identity to an existing account.
|
java.util.Optional<Account.Id> |
lookup(java.lang.String externalId) |
AuthResult |
unlink(Account.Id from,
AuthRequest who)
Unlink an authentication identity from an existing account.
|
AuthResult |
updateLink(Account.Id to,
AuthRequest who)
Update the link to another unique authentication identity to an existing account.
|
public java.util.Optional<Account.Id> lookup(java.lang.String externalId) throws AccountException
AccountException
public AuthResult authenticate(AuthRequest who) throws AccountException, java.io.IOException
who
- identity of the user, with any details we received about them.AccountException
- the account does not exist, and cannot be created, or exists, but
cannot be located, or is inactive.java.io.IOException
public AuthResult link(Account.Id to, AuthRequest who) throws AccountException, com.google.gwtorm.server.OrmException, java.io.IOException
to
- account to link the identity onto.who
- the additional identity.AccountException
- the identity belongs to a different account, or it cannot be linked at
this time.com.google.gwtorm.server.OrmException
java.io.IOException
public AuthResult updateLink(Account.Id to, AuthRequest who) throws com.google.gwtorm.server.OrmException, AccountException, java.io.IOException
Existing external identities with the same scheme will be removed and replaced with the new one.
to
- account to link the identity onto.who
- the additional identity.com.google.gwtorm.server.OrmException
AccountException
- the identity belongs to a different account, or it cannot be linked at
this time.java.io.IOException
public AuthResult unlink(Account.Id from, AuthRequest who) throws AccountException, com.google.gwtorm.server.OrmException, java.io.IOException
from
- account to unlink the identity from.who
- the identity to deleteAccountException
- the identity belongs to a different account, or it cannot be unlinked
at this time.com.google.gwtorm.server.OrmException
java.io.IOException