Top Description Inners Fields Constructors Methods
io.undertow.security.impl

public Class GenericHeaderAuthenticationMechanism

extends Object
implements AuthenticationMechanism
Class Inheritance
All Implemented Interfaces
io.undertow.security.api.AuthenticationMechanism
Imports
io.undertow.UndertowMessages, io.undertow.security.api.AuthenticationMechanism, .AuthenticationMechanismFactory, .SecurityContext, io.undertow.security.idm.Account, .IdentityManager, .PasswordCredential, io.undertow.server.HttpServerExchange, io.undertow.server.handlers.Cookie, io.undertow.server.handlers.form.FormParserFactory, io.undertow.util.HttpString, java.util.ArrayList, .List, .Map

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.
Authors
Stuart Douglas, Richard Opalka

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final AuthenticationMechanismFactory
public static final String
private final List<HttpString>
private final IdentityManager
private final String
public static final String
public static final String
private final List<String>

Constructor Summary

AccessConstructor and Description
public
GenericHeaderAuthenticationMechanism(String mechanismName, List<HttpString> identityHeaders, List<String> sessionCookieNames, IdentityManager identityManager)

Method Summary

Modifier and TypeMethod and Description
public AuthenticationMechanism.AuthenticationMechanismOutcome
authenticate(HttpServerExchange
The exchange
exchange
,
SecurityContext securityContext)

Implements io.undertow.security.api.AuthenticationMechanism.authenticate.

Perform authentication of the request.

private String
private String
public AuthenticationMechanism.ChallengeResult
sendChallenge(HttpServerExchange
The exchange
exchange
,
SecurityContext
The security context
securityContext
)

Implements io.undertow.security.api.AuthenticationMechanism.sendChallenge.

Send an authentication challenge to the remote client.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FACTORYback to summary
public static final AuthenticationMechanismFactory FACTORY
IDENTITY_HEADERback to summary
public static final String IDENTITY_HEADER
identityHeadersback to summary
private final List<HttpString> identityHeaders
identityManagerback to summary
private final IdentityManager identityManager
mechanismNameback to summary
private final String mechanismName
NAMEback to summary
public static final String NAME
SESSION_HEADERback to summary
public static final String SESSION_HEADER
sessionCookieNamesback to summary
private final List<String> sessionCookieNames

Constructor Detail

GenericHeaderAuthenticationMechanismback to summary
public GenericHeaderAuthenticationMechanism(String mechanismName, List<HttpString> identityHeaders, List<String> sessionCookieNames, IdentityManager identityManager)

Method Detail

authenticateback to summary
public AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext securityContext)

Implements io.undertow.security.api.AuthenticationMechanism.authenticate.

Doc from io.undertow.security.api.AuthenticationMechanism.authenticate.

Perform authentication of the request. Any potentially blocking work should be performed in the handoff executor provided

Parameters
exchange:HttpServerExchange

The exchange

Annotations
@Override
getPrincipalback to summary
private String getPrincipal(HttpServerExchange exchange)
getSessionback to summary
private String getSession(HttpServerExchange exchange)
sendChallengeback to summary
public AuthenticationMechanism.ChallengeResult sendChallenge(HttpServerExchange exchange, SecurityContext securityContext)

Implements io.undertow.security.api.AuthenticationMechanism.sendChallenge.

Doc from io.undertow.security.api.AuthenticationMechanism.sendChallenge.

Send 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 ChallengeResult and the most appropriate overall response code will be selected. This method should not return null.

Parameters
exchange:HttpServerExchange

The exchange

securityContext:SecurityContext

The security context

Returns:AuthenticationMechanism.ChallengeResult

A ChallengeResult indicating if a challenge was sent and the desired response code.

Annotations
@Override
io.undertow.security.impl back to summary

public Class GenericHeaderAuthenticationMechanism.Factory

extends Object
implements AuthenticationMechanismFactory
Class Inheritance
  • java.lang.Object
  • io.undertow.security.impl.GenericHeaderAuthenticationMechanism.Factory
All Implemented Interfaces
io.undertow.security.api.AuthenticationMechanismFactory

Constructor Summary

AccessConstructor and Description
public
Factory(IdentityManager identityManager)
Deprecated

public

Method Summary

Modifier and TypeMethod and Description
public AuthenticationMechanism
create(String
The name under which this factory was registered
mechanismName
,
IdentityManager
the IdentityManager instance asscociated with the deployment
identityManager
,
FormParserFactory
Parser to create a form data parser for a given request.
formParserFactory
,
Map<String, String>
The properties
properties
)

Overrides default io.undertow.security.api.AuthenticationMechanismFactory.create.

Creates an authentication mechanism that needs access to the deployment IdentityManager and specified properties

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Factoryback to summary
public Factory(IdentityManager identityManager)

Deprecated

Annotations
@Deprecated
Factoryback to summary
public Factory()

Method Detail

createback to summary
public AuthenticationMechanism create(String mechanismName, IdentityManager identityManager, FormParserFactory formParserFactory, Map<String, String> properties)

Overrides default io.undertow.security.api.AuthenticationMechanismFactory.create.

Doc from io.undertow.security.api.AuthenticationMechanismFactory.create.

Creates an authentication mechanism that needs access to the deployment IdentityManager and specified properties

Parameters
mechanismName:String

The name under which this factory was registered

identityManager:IdentityManager

the IdentityManager instance asscociated with the deployment

formParserFactory:FormParserFactory

Parser to create a form data parser for a given request.

properties:Map<String, String>

The properties

Returns:AuthenticationMechanism

The mechanism

Annotations
@Override