AuthenticationMechanism
public class BasicAuthenticationMechanism extends java.lang.Object implements AuthenticationMechanism
Modifier and Type | Class | Description |
---|---|---|
static class |
BasicAuthenticationMechanism.Factory |
AuthenticationMechanism.AuthenticationMechanismOutcome, AuthenticationMechanism.ChallengeResult
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
CHARSET |
|
static java.lang.String |
SILENT |
|
static java.lang.String |
USER_AGENT_CHARSETS |
A comma separated list of patterns and charsets.
|
Constructor | Description |
---|---|
BasicAuthenticationMechanism(java.lang.String realmName) |
|
BasicAuthenticationMechanism(java.lang.String realmName,
java.lang.String mechanismName) |
|
BasicAuthenticationMechanism(java.lang.String realmName,
java.lang.String mechanismName,
boolean silent) |
|
BasicAuthenticationMechanism(java.lang.String realmName,
java.lang.String mechanismName,
boolean silent,
IdentityManager identityManager) |
|
BasicAuthenticationMechanism(java.lang.String realmName,
java.lang.String mechanismName,
boolean silent,
IdentityManager identityManager,
java.nio.charset.Charset charset,
java.util.Map<java.util.regex.Pattern,java.nio.charset.Charset> userAgentCharsets) |
Modifier and Type | Method | Description |
---|---|---|
AuthenticationMechanism.AuthenticationMechanismOutcome |
authenticate(HttpServerExchange exchange,
SecurityContext securityContext) |
Perform authentication of the request.
|
AuthenticationMechanism.ChallengeResult |
sendChallenge(HttpServerExchange exchange,
SecurityContext securityContext) |
Send an authentication challenge to the remote client.
|
public static final java.lang.String SILENT
public static final java.lang.String CHARSET
public static final java.lang.String USER_AGENT_CHARSETS
public BasicAuthenticationMechanism(java.lang.String realmName)
public BasicAuthenticationMechanism(java.lang.String realmName, java.lang.String mechanismName)
public BasicAuthenticationMechanism(java.lang.String realmName, java.lang.String mechanismName, boolean silent)
public BasicAuthenticationMechanism(java.lang.String realmName, java.lang.String mechanismName, boolean silent, IdentityManager identityManager)
public BasicAuthenticationMechanism(java.lang.String realmName, java.lang.String mechanismName, boolean silent, IdentityManager identityManager, java.nio.charset.Charset charset, java.util.Map<java.util.regex.Pattern,java.nio.charset.Charset> userAgentCharsets)
public AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext securityContext)
AuthenticationMechanism
authenticate
in interface AuthenticationMechanism
exchange
- The exchangeHttpHandler.handleRequest(io.undertow.server.HttpServerExchange)
public AuthenticationMechanism.ChallengeResult sendChallenge(HttpServerExchange exchange, SecurityContext securityContext)
AuthenticationMechanism
The individual mechanisms should update the response headers and body of the message as appropriate however they should
not set the response code, instead that should be indicated in the AuthenticationMechanism.ChallengeResult
and the most appropriate
overall response code will be selected.
This method should not return null
.
sendChallenge
in interface AuthenticationMechanism
exchange
- The exchangesecurityContext
- The security contextAuthenticationMechanism.ChallengeResult
indicating if a challenge was sent and the desired response code.Copyright © 2018. All rights reserved.