Skip to content
Discussion options

You must be logged in to vote

Found an issue. My Session didn't have SPRING_SECURITY_CONTEXT attribute. (added SecurityContext manually
Pherhaps, additional logic may be added in beforeHandshake method (DgsHandshakeInterceptor)

   override fun beforeHandshake(
        request: ServerHttpRequest,
        response: ServerHttpResponse,
        wsHandler: WebSocketHandler,
        attributes: MutableMap<String, Any>
    ): Boolean {
        HttpSession session = getSession(request);
        if (session.attributes["SPRING_SECURITY_CONTEXT"].isNull()) {
             session.setAttribute("SPRING_SECURITY_CONTEXT", SecurityContextHolder.getContext())
         }
        if (request.headers[WebSocketHttpHeaders.SEC_WEBSOCKET_PR…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by VitalijF
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant