Package org.aktin.broker.websocket
Class HeaderAuthSessionConfigurator
java.lang.Object
javax.websocket.server.ServerEndpointConfig.Configurator
org.aktin.broker.websocket.HeaderAuthSessionConfigurator
public class HeaderAuthSessionConfigurator
extends javax.websocket.server.ServerEndpointConfig.Configurator
Websocket session configurator with authentication. Performs authentication
during websocket handshake. If successfull, authenticated user
Principal
instance is stored in the websocket Session.getUserProperties() with
the key AUTH_USER.- Author:
- R.W.Majeed
-
Field Summary
-
Constructor Summary
Constructors Constructor Description HeaderAuthSessionConfigurator(HeaderAuthentication auth, AuthCache cache) -
Method Summary
Modifier and Type Method Description voidmodifyHandshake(javax.websocket.server.ServerEndpointConfig sec, javax.websocket.server.HandshakeRequest request, javax.websocket.HandshakeResponse response)Methods inherited from class javax.websocket.server.ServerEndpointConfig.Configurator
checkOrigin, getEndpointInstance, getNegotiatedExtensions, getNegotiatedSubprotocol
-
Field Details
-
AUTH_USER
Websocket session user properties key where the authenticated userPrincipalis stored.- See Also:
- Constant Field Values
-
-
Constructor Details
-
HeaderAuthSessionConfigurator
-
-
Method Details
-
modifyHandshake
public void modifyHandshake(javax.websocket.server.ServerEndpointConfig sec, javax.websocket.server.HandshakeRequest request, javax.websocket.HandshakeResponse response)- Overrides:
modifyHandshakein classjavax.websocket.server.ServerEndpointConfig.Configurator
-