code: public static SecurityContext getSecurityContext() {
          Session session = ExecutionContext.getSession();
          @SuppressWarnings("resource")
          WebSocketSession ws = session == null ? null : session.getSocket();
          return ws == null ? null
                  : (SecurityContext) ws.getAttributes().get(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY);
      }
docs: Returns the security context from the execution context.
  
  @return The security context, or null if one cannot be determined.