Class LdapAuthBackend
- java.lang.Object
-
- com.google.gerrit.server.auth.ldap.LdapAuthBackend
-
- All Implemented Interfaces:
AuthBackend
public class LdapAuthBackend extends Object implements AuthBackend
Implementation of AuthBackend for the LDAP authentication system.
-
-
Constructor Summary
Constructors Constructor Description LdapAuthBackend(com.google.gerrit.server.auth.ldap.Helper helper, AuthConfig authConfig, org.eclipse.jgit.lib.Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthUser
authenticate(AuthRequest req)
Authenticate inspects the AuthRequest and returns authenticated user.String
getDomain()
-
-
-
Constructor Detail
-
LdapAuthBackend
@Inject public LdapAuthBackend(com.google.gerrit.server.auth.ldap.Helper helper, AuthConfig authConfig, org.eclipse.jgit.lib.Config config)
-
-
Method Detail
-
getDomain
public String getDomain()
- Specified by:
getDomain
in interfaceAuthBackend
- Returns:
- an identifier that uniquely describes the backend.
-
authenticate
public AuthUser authenticate(AuthRequest req) throws MissingCredentialsException, InvalidCredentialsException, UnknownUserException, UserNotAllowedException, AuthException
Description copied from interface:AuthBackend
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.- Specified by:
authenticate
in interfaceAuthBackend
- 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.
-
-