-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support OIDC Client JWT Bearer authentication
- Loading branch information
1 parent
99d258c
commit 5f8d63f
Showing
11 changed files
with
200 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
16 changes: 16 additions & 0 deletions
16
...ient-wiremock/src/main/java/io/quarkus/it/keycloak/JwtBearerAuthenticationOidcClient.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,16 @@ | ||
package io.quarkus.it.keycloak; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
@RegisterRestClient | ||
@RegisterProvider(value = OidcClientRequestCustomFilter.class) | ||
@Path("/") | ||
public interface JwtBearerAuthenticationOidcClient { | ||
|
||
@GET | ||
String echoToken(); | ||
} |
24 changes: 24 additions & 0 deletions
24
...c-client-wiremock/src/main/java/io/quarkus/it/keycloak/OidcClientRequestCustomFilter.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,24 @@ | ||
package io.quarkus.it.keycloak; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import jakarta.annotation.Priority; | ||
import jakarta.ws.rs.Priorities; | ||
|
||
import io.quarkus.oidc.client.filter.runtime.AbstractOidcClientRequestFilter; | ||
import io.quarkus.oidc.common.runtime.OidcConstants; | ||
|
||
@Priority(Priorities.AUTHENTICATION) | ||
public class OidcClientRequestCustomFilter extends AbstractOidcClientRequestFilter { | ||
|
||
@Override | ||
protected Map<String, String> additionalParameters() { | ||
return Map.of(OidcConstants.CLIENT_ASSERTION, "123456"); | ||
} | ||
|
||
@Override | ||
protected Optional<String> clientId() { | ||
return Optional.of("jwtbearer"); | ||
} | ||
} |
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
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