public class BasicAuthenticationMechanism extends Object implements AuthenticationMechanism
Modifier and Type | Class and Description |
---|---|
static class | BasicAuthenticationMechanism.Factory |
AuthenticationMechanism.AuthenticationMechanismOutcome, AuthenticationMechanism.ChallengeResult
Modifier and Type | Field and Description |
---|---|
static String | CHARSET |
static AuthenticationMechanismFactory | FACTORY |
static String | SILENT |
static String | USER_AGENT_CHARSETS A comma separated list of patterns and charsets. |
Constructor and Description |
---|
BasicAuthenticationMechanism(String realmName) |
BasicAuthenticationMechanism(String realmName, String mechanismName) |
BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent) |
BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent, IdentityManager identityManager) |
BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent, IdentityManager identityManager, Charset charset, Map<Pattern,Charset> userAgentCharsets) |
Modifier and Type | Method and 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 AuthenticationMechanismFactory FACTORY
public static final String SILENT
public static final String CHARSET
public static final String USER_AGENT_CHARSETS
public BasicAuthenticationMechanism(String realmName)
public BasicAuthenticationMechanism(String realmName, String mechanismName)
public BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent)
public BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent, IdentityManager identityManager)
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 © 2020 JBoss by Red Hat. All rights reserved.