public class OAuthRealm extends AbstractRealm
Modifier and Type | Method and Description |
---|---|
boolean |
allowsEdit(com.google.gerrit.reviewdb.client.Account.FieldName field)
Can the end-user modify this field of their own account?
|
AuthRequest |
authenticate(AuthRequest who)
Authenticates with the
OAuthLoginProvider specified
in the authentication request. |
com.google.gerrit.reviewdb.client.Account.Id |
lookup(String accountName)
Locate an account whose local username is the given account name.
|
void |
onCreateAccount(AuthRequest who,
com.google.gerrit.reviewdb.client.Account account) |
getEditableFields, getEmailAddresses, hasEmailAddress
public boolean allowsEdit(com.google.gerrit.reviewdb.client.Account.FieldName field)
Realm
public AuthRequest authenticate(AuthRequest who) throws AccountException
OAuthLoginProvider
specified
in the authentication request.
AccountManager
calls this method without password
if authenticity of the user has already been established.
In that case the AuthRequest
is supposed to contain
a resolved email address and we can skip the authentication
request to the OAuthLoginService
.who
- the authentication request.who
is returned unchanged.AccountException
- if the authentication request with
the OAuth2 server failed or no OAuthLoginProvider
was
available to handle the request.public void onCreateAccount(AuthRequest who, com.google.gerrit.reviewdb.client.Account account)
public com.google.gerrit.reviewdb.client.Account.Id lookup(String accountName)
Realm
Generally this only works for local realms, such as one backed by an LDAP
directory, or where there is an EmailExpander
configured that knows
how to convert the accountName into an email address, and then locate the
user by that email address.