Top Description Inners Fields Constructors Methods
io.undertow.servlet.handlers.security

public Class CachedAuthenticatedSessionHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
io.undertow.security.api.AuthenticatedSessionManager, .AuthenticatedSessionManager.AuthenticatedSession, .NotificationReceiver, .SecurityContext, .SecurityNotification, .SecurityNotification.EventType, io.undertow.server.HttpHandler, .HttpServerExchange, io.undertow.server.session.Session, io.undertow.servlet.handlers.ServletRequestContext, io.undertow.servlet.spec.HttpSessionImpl, .ServletContextImpl, io.undertow.servlet.util.SavedRequest, java.security.AccessController, jakarta.servlet.http.HttpSession

HttpHandler responsible for setting up the AuthenticatedSessionManager for cached authentications and registering a NotificationReceiver to receive the security notifications. This handler also forces the session to change its session ID on sucessful authentication.
Author
Darran Lofthouse

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
public static final String
private final HttpHandler
public static final String
private final NotificationReceiver
private final ServletContextImpl
private final AuthenticatedSessionManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
handleRequest(HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

private boolean
isCacheable(final SecurityNotification notification)

protected Session
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ATTRIBUTE_NAMEback to summary
public static final String ATTRIBUTE_NAME
nextback to summary
private final HttpHandler next
NO_ID_CHANGE_REQUIREDback to summary
public static final String NO_ID_CHANGE_REQUIRED
NOTIFICATION_RECEIVERback to summary
private final NotificationReceiver NOTIFICATION_RECEIVER
servletContextback to summary
private final ServletContextImpl servletContext
SESSION_MANAGERback to summary
private final AuthenticatedSessionManager SESSION_MANAGER

Constructor Detail

CachedAuthenticatedSessionHandlerback to summary
public CachedAuthenticatedSessionHandler(final HttpHandler next, final ServletContextImpl servletContext)

Method Detail

handleRequestback to summary
public void handleRequest(HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
isCacheableback to summary
private boolean isCacheable(final SecurityNotification notification)
underlyingSessionback to summary
protected Session underlyingSession(HttpSessionImpl httpSession)
io.undertow.servlet.handlers.security back to summary

private Class CachedAuthenticatedSessionHandler.SecurityNotificationReceiver

extends Object
implements NotificationReceiver
Class Inheritance
  • java.lang.Object
  • io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.SecurityNotificationReceiver
All Implemented Interfaces
io.undertow.security.api.NotificationReceiver

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
handleNotification(SecurityNotification notification)

Implements io.undertow.security.api.NotificationReceiver.handleNotification.

Handle a security related notification.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SecurityNotificationReceiverback to summary
private SecurityNotificationReceiver()

Method Detail

handleNotificationback to summary
public void handleNotification(SecurityNotification notification)

Implements io.undertow.security.api.NotificationReceiver.handleNotification.

Doc from io.undertow.security.api.NotificationReceiver.handleNotification.

Handle a security related notification. The SecurityNotification that is sent to be handled is a security event that has occurred, this is not an opportunity for that event to be validated - any Exception thrown by the handler will be logged but will not affect the result of the security event. The notifications are sent on the same thread that is currently processing the request that triggered the notification, if the handling of the notification is likely to be blocking then it should be dispatched to it's own worker thread. The one exception to this may be where the notification must be sure to have been handled before the response continues.

Annotations
@Override
io.undertow.servlet.handlers.security back to summary

private Class CachedAuthenticatedSessionHandler.ServletAuthenticatedSessionManager

extends Object
implements AuthenticatedSessionManager
Class Inheritance
  • java.lang.Object
  • io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.ServletAuthenticatedSessionManager
All Implemented Interfaces
io.undertow.security.api.AuthenticatedSessionManager

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public AuthenticatedSessionManager.AuthenticatedSession
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ServletAuthenticatedSessionManagerback to summary
private ServletAuthenticatedSessionManager()

Method Detail

clearSessionback to summary
public void clearSession(HttpServerExchange exchange)

Implements io.undertow.security.api.AuthenticatedSessionManager.clearSession.

Annotations
@Override
lookupSessionback to summary
public AuthenticatedSessionManager.AuthenticatedSession lookupSession(HttpServerExchange exchange)

Implements io.undertow.security.api.AuthenticatedSessionManager.lookupSession.

Annotations
@Override