feat: fixed 403 errors
All checks were successful
Format / formatting (push) Successful in 6s
Build / build (push) Successful in 40s
CI / build (push) Successful in 11s

This commit is contained in:
Pierre Tellier 2025-05-07 10:45:38 +02:00
parent 13845394e3
commit 1f0f9196c4
5 changed files with 2652 additions and 7 deletions

View File

@ -2,6 +2,7 @@ help:
@echo "make [clean dev-front prod dev-back dev]" @echo "make [clean dev-front prod dev-back dev]"
clean: clean:
pkill -9 node
@cp config/frontdev.env front/MyINPulse-front/.env @cp config/frontdev.env front/MyINPulse-front/.env
@cp config/frontdev.env .env @cp config/frontdev.env .env
@cp config/frontdev.env MyINPulse-back/.env @cp config/frontdev.env MyINPulse-back/.env

View File

@ -56,12 +56,18 @@ public class WebSecurityCustomConfiguration {
http.authorizeHttpRequests( http.authorizeHttpRequests(
authorize -> authorize ->
authorize authorize
.requestMatchers("/entrepreneur/**", "/shared/**") .requestMatchers("/entrepreneur/**")
.access(hasRole("REALM_MyINPulse-entrepreneur")) .access(hasRole("REALM_MyINPulse-entrepreneur"))
.requestMatchers("/admin/**", "/shared/**") .requestMatchers("/admin/**")
.access(hasRole("REALM_MyINPulse-admin")) .access(hasRole("REALM_MyINPulse-admin"))
.requestMatchers("/shared/**")
.hasAnyRole(
"REALM_MyINPulse-admin",
"REALM_MyINPulse-entrepreneur")
.requestMatchers("/unauth/**") .requestMatchers("/unauth/**")
.authenticated()) .authenticated()
.anyRequest()
.denyAll())
.oauth2ResourceServer( .oauth2ResourceServer(
oauth2 -> oauth2 ->
oauth2.jwt( oauth2.jwt(

View File

@ -1,6 +1,6 @@
spring.application.name=myinpulse spring.application.name=myinpulse
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://localhost:7080/realms/test/protocol/openid-connect/certs spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://localhost:7080/realms/${VITE_KEYCLOAK_REALM}/protocol/openid-connect/certs
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:7080/realms/test spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:7080/realms/${VITE_KEYCLOAK_REALM}
spring.datasource.url=jdbc:postgresql://${DATABASE_URL}/${BACKEND_DB} spring.datasource.url=jdbc:postgresql://${DATABASE_URL}/${BACKEND_DB}
spring.datasource.username=${BACKEND_USER} spring.datasource.username=${BACKEND_USER}
spring.datasource.password=${BACKEND_PASSWORD} spring.datasource.password=${BACKEND_PASSWORD}

View File

@ -16,7 +16,7 @@ BACKEND_PASSWORD=backend_db_user_password
DATABASE_URL=localhost:5433 DATABASE_URL=localhost:5433
VITE_KEYCLOAK_URL=http://localhost:7080 VITE_KEYCLOAK_URL=http://localhost:7080
VITE_KEYCLOAK_CLIENT_ID=myinpulse-dev VITE_KEYCLOAK_CLIENT_ID=MyINPulse-vite
VITE_KEYCLOAK_REALM=test VITE_KEYCLOAK_REALM=MyINPulse
VITE_APP_URL=http://localhost:5173 VITE_APP_URL=http://localhost:5173
VITE_BACKEND_URL=http://localhost:8081/ VITE_BACKEND_URL=http://localhost:8081/

2638
keycloak/realm.json Normal file

File diff suppressed because it is too large Load Diff