File tree Expand file tree Collapse file tree 4 files changed +12
-16
lines changed
java/com/lunatech/leaderboard
controller/provider/filter Expand file tree Collapse file tree 4 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 80
80
<artifactId >quarkus-oidc</artifactId >
81
81
</dependency >
82
82
83
- <dependency >
84
- <groupId >io.quarkus</groupId >
85
- <artifactId >quarkus-oidc-client</artifactId >
86
- </dependency >
87
-
88
83
<dependency >
89
84
<groupId >io.quarkus</groupId >
90
85
<artifactId >quarkus-keycloak-authorization</artifactId >
Original file line number Diff line number Diff line change 1
1
package com .lunatech .leaderboard .client .graphql .lunagraph ;
2
2
3
- import io .quarkus .oidc .client .Tokens ;
4
3
import io .smallrye .graphql .client .typesafe .api .TypesafeGraphQLClientBuilder ;
4
+ import org .eclipse .microprofile .jwt .JsonWebToken ;
5
5
6
- import javax .inject . Singleton ;
6
+ import javax .enterprise . context . RequestScoped ;
7
7
8
8
public class GraphQLClients {
9
9
10
- @ Singleton
11
- public LunagraphApi lunagraphApi (Tokens tokens ) {
10
+ @ RequestScoped
11
+ public LunagraphApi lunagraphApi (JsonWebToken jwt ) {
12
12
return TypesafeGraphQLClientBuilder .newBuilder ()
13
- .header ("Authorization" , "Bearer " + tokens . getAccessToken ())
13
+ .header ("Authorization" , "Bearer " + jwt . getRawToken ())
14
14
.configKey ("lunagraph" )
15
15
.build (LunagraphApi .class );
16
16
}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ private void addUserEmailToHeader(ContainerRequestContext context) {
28
28
private Optional <String > securityEmail () {
29
29
return Optional .ofNullable (securityIdentity )
30
30
.map (SecurityIdentity ::getPrincipal )
31
+ .filter (principal -> principal instanceof OidcJwtCallerPrincipal )
31
32
.map (principal -> (OidcJwtCallerPrincipal ) principal )
32
33
.map (principal -> principal .getClaim ("email" ));
33
34
}
Original file line number Diff line number Diff line change @@ -13,11 +13,6 @@ quarkus:
13
13
tls :
14
14
verification : none
15
15
16
- oidc-client :
17
- auth-server-url : http://localhost:8081/realms/Quarkus
18
- credentials :
19
- secret : secret
20
-
21
16
keycloak :
22
17
devservices :
23
18
enabled : true
@@ -27,4 +22,9 @@ quarkus:
27
22
# Swagger
28
23
smallrye-openapi :
29
24
security-scheme-name : SecurityScheme
30
- oidc-open-id-connect-url : http://localhost:8081/realms/Quarkus/.well-known/openid-configuration
25
+ oidc-open-id-connect-url : http://localhost:8081/realms/Quarkus/.well-known/openid-configuration
26
+
27
+ log :
28
+ category :
29
+ " io.quarkus.oidc " :
30
+ level : DEBUG
You can’t perform that action at this time.
0 commit comments