PMT-14: JWT Auth #1

Merged
SZUT-Dominik merged 3 commits from story/PMT-14-api-authentizierung-per into trunk 2024-09-27 11:26:16 +00:00
2 changed files with 18 additions and 1 deletions
Showing only changes of commit 1e65f834f5 - Show all commits

View file

@ -48,6 +48,11 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa") implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-validation") implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
// Postgres
runtimeOnly("org.postgresql:postgresql") runtimeOnly("org.postgresql:postgresql")
// Lombok // Lombok
@ -57,6 +62,7 @@ dependencies {
// Test // Test
testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers") testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("org.testcontainers:junit-jupiter") testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:postgresql") testImplementation("org.testcontainers:postgresql")
testRuntimeOnly("org.junit.platform:junit-platform-launcher") testRuntimeOnly("org.junit.platform:junit-platform-launcher")

View file

@ -7,3 +7,14 @@ spring.datasource.url=jdbc:postgresql://localhost:5432/pmt
spring.datasource.username=pmt_user spring.datasource.username=pmt_user
spring.datasource.password=pmt123 spring.datasource.password=pmt123
spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.hibernate.ddl-auto=create-drop
# JWT Auth
spring.security.oauth2.client.registration.keycloak.client-id=employee-management-service
spring.security.oauth2.client.registration.keycloak.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.keycloak.scope=openid
spring.security.oauth2.client.provider.keycloak.issuer-uri=https://keycloak.szut.dev/auth/realms/szut
spring.security.oauth2.client.provider.keycloak.user-name-attribute=preferred_username
spring.security.oauth2.resourceserver.jwt.issuer-uri=https://keycloak.szut.dev/auth/realms/szut
# Debugging
logging.level.org.springframework.security=DEBUG