Package io.undertow.security.impl
Class GenericHeaderAuthenticationMechanism
java.lang.Object
io.undertow.security.impl.GenericHeaderAuthenticationMechanism
- All Implemented Interfaces:
AuthenticationMechanism
A authentication mechanism that requires the presence of two headers in the request. One of these will be used as a
principal and the other as a password credential.
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.undertow.security.api.AuthenticationMechanism
AuthenticationMechanism.AuthenticationMechanismOutcome, AuthenticationMechanism.ChallengeResult -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AuthenticationMechanismFactorystatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionGenericHeaderAuthenticationMechanism(String mechanismName, List<String> identityHeaders, List<String> sessionCookieNames, IdentityManager identityManager) -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(HttpServerExchange exchange, SecurityContext securityContext) Perform authentication of the request.sendChallenge(HttpServerExchange exchange, SecurityContext securityContext) Send an authentication challenge to the remote client.
-
Field Details
-
FACTORY
-
NAME
- See Also:
-
IDENTITY_HEADER
- See Also:
-
SESSION_HEADER
- See Also:
-
-
Constructor Details
-
GenericHeaderAuthenticationMechanism
-
-
Method Details
-
authenticate
public AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext securityContext) Description copied from interface:AuthenticationMechanismPerform authentication of the request. Any potentially blocking work should be performed in the handoff executor provided- Specified by:
authenticatein interfaceAuthenticationMechanism- Parameters:
exchange- The exchange- Returns:
-
sendChallenge
public AuthenticationMechanism.ChallengeResult sendChallenge(HttpServerExchange exchange, SecurityContext securityContext) Description copied from interface:AuthenticationMechanismSend an authentication challenge to the remote client.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.ChallengeResultand the most appropriate overall response code will be selected. This method should not returnnull.- Specified by:
sendChallengein interfaceAuthenticationMechanism- Parameters:
exchange- The exchangesecurityContext- The security context- Returns:
- A
AuthenticationMechanism.ChallengeResultindicating if a challenge was sent and the desired response code.
-