jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.02k forks source link

[jhipster-sample-app-websocket] Websocket tracker not working #24722

Closed duongxinh2003 closed 10 months ago

duongxinh2003 commented 10 months ago
Overview of the issue

Websocket demo app throws 403 Forbidden

Motivation for or Use Case

Run for example of Spring security WebSocket

Reproduce the error

Clone source code from repository jhipster-sample-app-websocket

  1. Run npm install to get dependencies
  2. Run Backend by command line ./mvnw
  3. Run Frontend by command line npm start When login page http://localhost:9000/ and then checking Devtools -> Network tab, an error occurred when calling Websocket: http://localhost:9000/websocket/tracker/info?t=1704189156457 (403 Fobidden) image
Related issues
Suggest a Fix
JHipster Version(s)

8.1.0

JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
mshima commented 10 months ago

As stated in the message authentication is required. Websocket implementation uses sockjs and requires the authorization token to be passed through headers. The sample implementation is available at admin/tracker.

duongxinh2003 commented 10 months ago

Thanks!