Closed IShostak closed 6 months ago
I was able to reproduce this issue with @PreAuthorize("hasRole('ADMIN')")
and @PreAuthorize("hasAuthority('ROLE_ADMIN')")
. If I change the web framework to Angular in .yo-rc.json
and re-generate everything, it works as expected.
It's possible React needs a similar fix that @atomfrede did for Angular to fix https://github.com/jhipster/generator-jhipster/issues/24396.
I decided to try it with Vue, but ran into an issue with the theme:
NFO] Error: Can't find stylesheet to import.
[INFO] ╷
[INFO] 9 │ @import 'bootswatch/dist/quartz/variables';
[INFO] │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] ╵
[INFO] src/main/webapp/content/scss/vendor.scss 9:9 root stylesheet
To workaround this bug, I deleted the following from .yo-rc.json
and re-generated the app:
"clientTheme": "quartz",
"clientThemeVariant": "dark",
Vue handles it properly as well.
Can you upload a sample project with the issue @mraible in order for me to take a look into it
@BrayanMnz I generated one using jhipster jdl blog-oauth2
, then modified the BlogResource
to have the @PreAuthorize
annotation on its getAllBlogs()
method.
Overview of the issue
Spring security + Keycloak = access denied infinite loop
Motivation for or Use Case
Basic security setup with annotation doesn't work
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
8.2.1
JHipster configuration
.yo-rc.json file
Environment and Tools
openjdk version "21.0.1" 2023-10-17 OpenJDK Runtime Environment (build 21.0.1+12-29) OpenJDK 64-Bit Server VM (build 21.0.1+12-29, mixed mode, sharing)
git version 2.43.0
node: v21.7.0 npm: 10.5.0
Docker version 25.0.3, build 4debf41
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
Mac OS Sonoma, Chrome