Class CsrfTokenHandshakeInterceptor
- java.lang.Object
-
- org.springframework.security.messaging.web.socket.server.CsrfTokenHandshakeInterceptor
-
- All Implemented Interfaces:
org.springframework.web.socket.server.HandshakeInterceptor
public final class CsrfTokenHandshakeInterceptor extends java.lang.Object implements org.springframework.web.socket.server.HandshakeInterceptor
Loads a CsrfToken from the HttpServletRequest and HttpServletResponse to populate the WebSocket attributes. This is used as the expected CsrfToken when validating connection requests to ensure only the same origin connects.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description CsrfTokenHandshakeInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, java.lang.Exception exception)
boolean
beforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, java.util.Map<java.lang.String,java.lang.Object> attributes)
-
-
-
Method Detail
-
beforeHandshake
public boolean beforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, java.util.Map<java.lang.String,java.lang.Object> attributes)
- Specified by:
beforeHandshake
in interfaceorg.springframework.web.socket.server.HandshakeInterceptor
-
afterHandshake
public void afterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, java.lang.Exception exception)
- Specified by:
afterHandshake
in interfaceorg.springframework.web.socket.server.HandshakeInterceptor
-
-