-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1813 from fedinskiy/oidc-tp
Coverage for JSON tokens
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...rkus/ts/security/keycloak/oidcclient/extended/restclient/principal/JsonTokenResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.quarkus.ts.security.keycloak.oidcclient.extended.restclient.principal; | ||
|
||
import jakarta.inject.Inject; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.rest.client.inject.RestClient; | ||
|
||
import io.quarkus.ts.security.keycloak.oidcclient.extended.restclient.principal.clients.JsonTokenClient; | ||
|
||
@Path("/json-propagation-filter") | ||
public class JsonTokenResource { | ||
|
||
@Inject | ||
@RestClient | ||
JsonTokenClient jsonClient; | ||
|
||
@GET | ||
public String getUserNameThroughJson() { | ||
return jsonClient.getUserName(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...s/security/keycloak/oidcclient/extended/restclient/principal/clients/JsonTokenClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkus.ts.security.keycloak.oidcclient.extended.restclient.principal.clients; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; | ||
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
import io.quarkus.oidc.token.propagation.JsonWebTokenRequestFilter; | ||
|
||
@RegisterRestClient | ||
@RegisterClientHeaders | ||
@Path("/principal") | ||
@RegisterProvider(JsonWebTokenRequestFilter.class) | ||
public interface JsonTokenClient { | ||
|
||
@GET | ||
String getUserName(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters