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

public Class ExternalAuthenticationMechanism

extends Object
implements AuthenticationMechanism
Class Inheritance
All Implemented Interfaces
io.undertow.security.api.AuthenticationMechanism
Imports
io.undertow.security.api.AuthenticationMechanism, .AuthenticationMechanismFactory, .SecurityContext, io.undertow.security.idm.Account, .ExternalCredential, .IdentityManager, io.undertow.server.HttpServerExchange, io.undertow.server.handlers.form.FormParserFactory, io.undertow.util.AttachmentKey, java.util.Map

Authentication mechanism that uses an externally provided principal.

Warning

This method performs no verification. It must only be used if there is no way for an end user to modify the principal, for example if Undertow is behind a front end server that is responsible for authentication.

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
public

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 IdentityManager
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

EXTERNAL_AUTHENTICATION_TYPEback to summary
public static final AttachmentKey<String> EXTERNAL_AUTHENTICATION_TYPE
EXTERNAL_PRINCIPALback to summary
public static final AttachmentKey<String> EXTERNAL_PRINCIPAL
FACTORYback to summary
public static final AuthenticationMechanismFactory FACTORY
identityManagerback to summary
private final IdentityManager identityManager
NAMEback to summary
public static final String NAME
nameback to summary
private final String name

Constructor Detail

ExternalAuthenticationMechanismback to summary
public ExternalAuthenticationMechanism(String name, IdentityManager identityManager)
ExternalAuthenticationMechanismback to summary
public ExternalAuthenticationMechanism(String name)
ExternalAuthenticationMechanismback to summary
public ExternalAuthenticationMechanism()

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
getIdentityManagerback to summary
private IdentityManager getIdentityManager(SecurityContext securityContext)
Annotations
@SuppressWarnings:deprecation
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 final Class ExternalAuthenticationMechanism.Factory

extends Object
implements AuthenticationMechanismFactory
Class Inheritance
  • java.lang.Object
  • io.undertow.security.impl.ExternalAuthenticationMechanism.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