Secure WebSocket with Spring Security OAuth 2.0, AngularJS and SockJs

676 views Asked by At

I'm trying to implement WebSocket support with Angular+SockJs on front-end, and Spring on backend. We are using Spring Security with OAuth 2.0 token based authorization. Spec tell us that i should pass token via STOMP client at connect time and use Interceptor on backend to provide Principal. But i don't like this approach because i need to copy logic from Security configuration to get Principal from Token. Is it possible to catch SockJs request in Angular Interceptor and add Authentication header?

0

There are 0 answers