Package com.google.gerrit.server.auth
Interface AuthBackend
- All Known Implementing Classes:
InternalAuthBackend
,UniversalAuthBackend
public interface AuthBackend
Implementations of AuthBackend authenticate users for incoming request.
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(AuthRequest req) Authenticate inspects the AuthRequest and returns authenticated user.Returns an identifier that uniquely describes the backend.
-
Method Details
-
getDomain
String getDomain()Returns an identifier that uniquely describes the backend. -
authenticate
AuthUser authenticate(AuthRequest req) throws MissingCredentialsException, InvalidCredentialsException, UnknownUserException, UserNotAllowedException, AuthException Authenticate inspects the AuthRequest and returns authenticated user. If the request is unable to be authenticated, an exception will be thrown. TheMissingCredentialsException
must be thrown when there are no credentials for the request. It is expected that at most one AuthBackend will either return an AuthUser or throw a non-MissingCredentialsException.- Parameters:
req
- the object describing the request.- Returns:
- the successfully authenticated user.
- Throws:
MissingCredentialsException
- when there are no credentials.InvalidCredentialsException
- when the credentials are present and invalid.UnknownUserException
- when the credentials are valid but there is no matching user.UserNotAllowedException
- when the credentials are valid but the user is not allowed.AuthException
- when any other error occurs.
-