Skip to content

Commit f5ddf8a

Browse files
author
Dennis Labordus
authored
Merge pull request #62 from com-pas/change-security-libs
Swithed from OpenID Library to SmallRye JWT.
2 parents 9c0f2a8 + a24b028 commit f5ddf8a

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

app/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ SPDX-License-Identifier: Apache-2.0
6161
<groupId>io.quarkus</groupId>
6262
<artifactId>quarkus-resteasy</artifactId>
6363
</dependency>
64+
<dependency>
65+
<groupId>io.quarkus</groupId>
66+
<artifactId>quarkus-smallrye-jwt</artifactId>
67+
</dependency>
6468
<dependency>
6569
<groupId>io.quarkus</groupId>
6670
<artifactId>quarkus-smallrye-openapi</artifactId>
@@ -81,10 +85,6 @@ SPDX-License-Identifier: Apache-2.0
8185
<groupId>io.quarkus</groupId>
8286
<artifactId>quarkus-hibernate-validator</artifactId>
8387
</dependency>
84-
<dependency>
85-
<groupId>io.quarkus</groupId>
86-
<artifactId>quarkus-oidc</artifactId>
87-
</dependency>
8888

8989
<!-- Test Dependencies -->
9090
<dependency>
@@ -104,7 +104,7 @@ SPDX-License-Identifier: Apache-2.0
104104
</dependency>
105105
<dependency>
106106
<groupId>io.quarkus</groupId>
107-
<artifactId>quarkus-test-security-oidc</artifactId>
107+
<artifactId>quarkus-test-security</artifactId>
108108
<scope>test</scope>
109109
</dependency>
110110
<dependency>

app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasCommonResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class CompasCommonResource {
3232
@Path("/type/list")
3333
@Produces(MediaType.APPLICATION_XML)
3434
public TypeListResponse list() {
35-
// Retrieve the roles the loggedin user has.
35+
// Retrieve the roles the logged in user has.
3636
var roles = securityIdentity.getRoles();
3737

3838
var response = new TypeListResponse();

app/src/main/resources/application.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ basex.password = ${BASEX_PASSWORD:admin}
2222
%dev.quarkus.log.level = DEBUG
2323
%dev.quarkus.log.category."org.lfenergy.compas.scl.data".level = DEBUG
2424

25-
# Open ID Connect
26-
quarkus.oidc.auth-server-url = ${AUTH_SERVER_URL:http://localhost:8080/auth/realms/compas}
27-
quarkus.oidc.client-id = ${AUTH_CLIENT_ID:scl-data-service}
28-
quarkus.oidc.application-type = service
25+
# Smallrye JWT Properties (Microprofile)
26+
smallrye.jwt.verify.key.location = ${JWT_VERIFY_KEY:http://localhost:8089/auth/realms/compas/protocol/openid-connect/certs}
27+
smallrye.jwt.path.groups = resource_access/scl-data-service/roles
28+
mp.jwt.verify.issuer = ${JWT_VERIFY_ISSUER:http://localhost:8089/auth/realms/compas}
29+
mp.jwt.verify.audiences = ${JWT_VERIFY_CLIENT_ID:scl-data-service}
2930

3031
quarkus.http.auth.permission.deny-default.paths=/*
3132
quarkus.http.auth.permission.deny-default.policy=deny

0 commit comments

Comments
 (0)