public class Authenticator extends Object
LoginContext
for the chosen realm.
Authenticator supports the following authentication methods:
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_X509_CERTIFICATE |
static String |
AUTHENTICATION_SCHEME_BASIC |
static String |
HEADER_AUTHORIZATION |
Constructor and Description |
---|
Authenticator(javax.servlet.http.HttpServletRequest request,
AuthenticationConfiguration authConfiguration)
Request-based authenticator such as when authenticating direct Jolokia accesses.
|
Authenticator(javax.servlet.http.HttpServletRequest request,
AuthenticationConfiguration authConfiguration,
String username,
String password)
Explicit username/password authenticator when authenticating users from login page.
|
Modifier and Type | Method and Description |
---|---|
AuthenticateResult |
authenticate(Consumer<Subject> callback) |
protected boolean |
checkRoles(Subject subject,
String role,
String rolePrincipalClasses) |
protected Subject |
doAuthenticate() |
static void |
extractAuthHeader(javax.servlet.http.HttpServletRequest request,
BiConsumer<String,String> callback)
Extracts username/password from Authorization header.
|
boolean |
hasNoCredentials() |
protected Subject |
initSubject() |
boolean |
isUsernamePasswordSet() |
protected void |
login(Subject subject,
String realm,
Configuration configuration) |
static void |
logout(AuthenticationConfiguration authConfiguration,
Subject subject) |
public static final String HEADER_AUTHORIZATION
public static final String AUTHENTICATION_SCHEME_BASIC
public static final String ATTRIBUTE_X509_CERTIFICATE
public Authenticator(javax.servlet.http.HttpServletRequest request, AuthenticationConfiguration authConfiguration, String username, String password)
public Authenticator(javax.servlet.http.HttpServletRequest request, AuthenticationConfiguration authConfiguration)
public static void extractAuthHeader(javax.servlet.http.HttpServletRequest request, BiConsumer<String,String> callback)
public boolean isUsernamePasswordSet()
public boolean hasNoCredentials()
public static void logout(AuthenticationConfiguration authConfiguration, Subject subject)
public AuthenticateResult authenticate(Consumer<Subject> callback)
protected Subject doAuthenticate()
protected Subject initSubject()
protected void login(Subject subject, String realm, Configuration configuration) throws LoginException
LoginException
Copyright © 2021 JBoss by Red Hat. All rights reserved.