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

public Class GSSAPIAuthenticationMechanism

extends Object
implements AuthenticationMechanism
Class Inheritance
All Implemented Interfaces
io.undertow.security.api.AuthenticationMechanism
Imports
io.undertow.UndertowLogger, io.undertow.security.api.AuthenticationMechanism, .GSSAPIServerSubjectFactory, .SecurityContext, io.undertow.security.idm.Account, .GSSContextCredential, .IdentityManager, io.undertow.server.HttpServerExchange, .ServerConnection, io.undertow.server.handlers.proxy.ExclusivityChecker, io.undertow.util.AttachmentKey, .FlexBase64, org.ietf.jgss.GSSContext, .GSSCredential, .GSSException, .GSSManager, .Oid, java.io.IOException, java.nio.ByteBuffer, java.security.GeneralSecurityException, .Principal, .PrivilegedActionException, .PrivilegedExceptionAction, java.util.List, javax.security.auth.Subject, javax.security.auth.kerberos.KerberosPrincipal

io.undertow.security.api.AuthenticationMechanism for GSSAPI / SPNEGO based authentication.

GSSAPI authentication is associated with the HTTP connection, as long as a connection is being re-used allow the authentication state to be re-used.

TODO - May consider an option to allow it to also be associated with the underlying session but that has it's own risks so would need to come with a warning.

Author
Darran Lofthouse

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class

Field Summary

Modifier and TypeField and Description
private static final Oid[]
public static final ExclusivityChecker
private final IdentityManager
private final Oid[]
private static final String
private static final String
private static final String
private final GSSAPIServerSubjectFactory

Constructor Summary

AccessConstructor and Description
public
GSSAPIAuthenticationMechanism(final GSSAPIServerSubjectFactory subjectFactory, IdentityManager identityManager, Oid... supportedMechanisms)

public
GSSAPIAuthenticationMechanism(final GSSAPIServerSubjectFactory subjectFactory, Oid... supportedMechanisms)

public

Method Summary

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

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

Perform authentication of the request.

private String
private IdentityManager
public AuthenticationMechanism.AuthenticationMechanismOutcome
runGSSAPI(final HttpServerExchange exchange, final ByteBuffer challenge, final SecurityContext securityContext)

public AuthenticationMechanism.ChallengeResult
sendChallenge(final HttpServerExchange
The exchange
exchange
,
final 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

DEFAULT_MECHANISMSback to summary
private static final Oid[] DEFAULT_MECHANISMS
EXCLUSIVITY_CHECKERback to summary
public static final ExclusivityChecker EXCLUSIVITY_CHECKER
identityManagerback to summary
private final IdentityManager identityManager
mechanismsback to summary
private final Oid[] mechanisms
nameback to summary
private static final String name
NEGOTIATE_PREFIXback to summary
private static final String NEGOTIATE_PREFIX
NEGOTIATION_PLAINback to summary
private static final String NEGOTIATION_PLAIN
subjectFactoryback to summary
private final GSSAPIServerSubjectFactory subjectFactory

Constructor Detail

GSSAPIAuthenticationMechanismback to summary
public GSSAPIAuthenticationMechanism(final GSSAPIServerSubjectFactory subjectFactory, IdentityManager identityManager, Oid... supportedMechanisms)
GSSAPIAuthenticationMechanismback to summary
public GSSAPIAuthenticationMechanism(final GSSAPIServerSubjectFactory subjectFactory, Oid... supportedMechanisms)
GSSAPIAuthenticationMechanismback to summary
public GSSAPIAuthenticationMechanism(final GSSAPIServerSubjectFactory subjectFactory)

Method Detail

authenticateback to summary
public AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(final HttpServerExchange exchange, final 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
getHostNameback to summary
private String getHostName(final HttpServerExchange exchange)
getIdentityManagerback to summary
private IdentityManager getIdentityManager(SecurityContext securityContext)
Annotations
@SuppressWarnings:deprecation
runGSSAPIback to summary
public AuthenticationMechanism.AuthenticationMechanismOutcome runGSSAPI(final HttpServerExchange exchange, final ByteBuffer challenge, final SecurityContext securityContext)
sendChallengeback to summary
public AuthenticationMechanism.ChallengeResult sendChallenge(final HttpServerExchange exchange, final 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.

io.undertow.security.impl back to summary

private Class GSSAPIAuthenticationMechanism.AcceptSecurityContext

extends Object
implements PrivilegedExceptionAction<AuthenticationMechanism.AuthenticationMechanismOutcome>
Class Inheritance
  • java.lang.Object
  • io.undertow.security.impl.GSSAPIAuthenticationMechanism.AcceptSecurityContext
All Implemented Interfaces
java.security.PrivilegedExceptionAction

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final HttpServerExchange
private final SecurityContext

Constructor Summary

AccessConstructor and Description
private
AcceptSecurityContext(final HttpServerExchange exchange, final ByteBuffer challenge, final SecurityContext securityContext)

Method Summary

Modifier and TypeMethod and Description
public AuthenticationMechanism.AuthenticationMechanismOutcome
run()

Implements java.security.PrivilegedExceptionAction.run.

Performs the computation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

challengeback to summary
private final ByteBuffer challenge
exchangeback to summary
private final HttpServerExchange exchange
securityContextback to summary
private final SecurityContext securityContext

Constructor Detail

AcceptSecurityContextback to summary
private AcceptSecurityContext(final HttpServerExchange exchange, final ByteBuffer challenge, final SecurityContext securityContext)

Method Detail

runback to summary
public AuthenticationMechanism.AuthenticationMechanismOutcome run() throws GSSException

Implements java.security.PrivilegedExceptionAction.run.

Doc from java.security.PrivilegedExceptionAction.run.

Performs the computation. This method will be called by AccessController.doPrivileged after enabling privileges.

Returns:AuthenticationMechanism.AuthenticationMechanismOutcome

a class-dependent value that may represent the results of the computation. Each class that implements PrivilegedExceptionAction should document what (if anything) this value represents.

io.undertow.security.impl back to summary

private Class GSSAPIAuthenticationMechanism.NegotiationContext

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.security.impl.GSSAPIAuthenticationMechanism.NegotiationContext

Field Summary

Modifier and TypeField and Description
pack-priv static final AttachmentKey<GSSAPIAuthenticationMechanism.NegotiationContext>
private GSSContext
private Principal
private byte[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv GSSContext
pack-priv Principal
pack-priv boolean
pack-priv void
pack-priv void
setResponseToken(byte[] responseToken)

pack-priv byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ATTACHMENT_KEYback to summary
pack-priv static final AttachmentKey<GSSAPIAuthenticationMechanism.NegotiationContext> ATTACHMENT_KEY
gssContextback to summary
private GSSContext gssContext
principalback to summary
private Principal principal
responseTokenback to summary
private byte[] responseToken

Constructor Detail

NegotiationContextback to summary
private NegotiationContext()

Method Detail

getGssContextback to summary
pack-priv GSSContext getGssContext()
getPrincipalback to summary
pack-priv Principal getPrincipal()
isEstablishedback to summary
pack-priv boolean isEstablished()
setGssContextback to summary
pack-priv void setGssContext(GSSContext gssContext)
setResponseTokenback to summary
pack-priv void setResponseToken(byte[] responseToken)
useResponseTokenback to summary
pack-priv byte[] useResponseToken()