-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jHipster 8.1.0 broken @AuthenticationPrincipal failed to get UserDetails #25240
Comments
JHipster has completed the sample check This check uses |
based on my comparison with 8.1.0 and 7.9.4, these 3 important classes were missing. The renaming of UserJwtController to AuthenticateController was totally unnecessary. You should get back those 3 classes, and modify the necessary JWT token verification and the assigning the user principal there. Suggested fix:
the SecurityConfiguration can roughly follow the same format as before.
and the new JWTConfigurer
and the new AuthenticateController(formerly known as the UserJWTController)
I'll leave it to you guys to revert some changes and modify them accordingly. Lemme know your thoughts on whether my new suggestions are sound. I just tested with another sample project and it works. @mraible |
For jwt you should use:
|
We moved away from custom jwt handling to spring-boot provided one. |
There is nothing to do on JHipster side. |
Overview of the issue
@AuthenticationPrincipal failed to get UserDetails
Motivation for or Use Case
This has got to be an important utility to use for security measures, but it's broken.
Reproduce the error
https://github.com/kevintanhongann/jhipster8-broken-auth
start the app, make sure to login as either admin or user, then from the vue ui, navigate to localhost:5173/demo, and that component will call localhost:8080/api/demo that calls the userDetails principal and fails.
Related issues
Suggest a Fix
JHipster Version(s)
8.1.0
JHipster configuration
.yo-rc.json file
Environment and Tools
openjdk version "21.0.2" 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)
git version 2.40.1
node: v18.19.0
npm: 10.2.3
Docker version 25.0.3, build 4debf41
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Browsers and Operating System
Firefox and Ubuntu 23.10
The text was updated successfully, but these errors were encountered: