OpenID Connect クライアントとトークン伝播のクイックスタート
OpenID Connect (OIDC) および OAuth2 クライアントをフィルターとともに使用して、アプリケーションでアクセストークンを取得、更新、伝播する方法を学びます。
Quarkus での OIDC Client および Token Propagation のサポートに関する詳細は、OpenID Connect (OIDC) および OAuth2 クライアントとフィルターのリファレンスガイド を参照してください。
ベアラートークン認可を使用してアプリケーションを保護する方法については、OpenID Connect (OIDC) ベアラー認証 ガイドを参照してください。
前提条件
このガイドを完成させるには、以下が必要です:
-
約15分
-
IDE
-
JDK 17+がインストールされ、
JAVA_HOMEが適切に設定されていること -
Apache Maven 3.9.15
-
動作するコンテナランタイム(Docker, Podman)
-
使用したい場合は、 Quarkus CLI
-
ネイティブ実行可能ファイルをビルドしたい場合、MandrelまたはGraalVM(あるいはネイティブなコンテナビルドを使用する場合はDocker)をインストールし、 適切に設定していること
アーキテクチャー
In this example, an application is built with two Jakarta REST resources, FrontendResource and ProtectedResource.
-
FrontendResourceuses one of three methods to propagate access tokens toProtectedResource:-
OIDC クライアントフィルターを使用して、トークンを伝播する前にトークンを取得できます。
-
プログラムで作成された OIDC クライアントを使用してトークンを取得し、それを HTTP
Authorizationヘッダー値として REST クライアントメソッドに渡すことで伝播できます。 -
OIDC トークン伝播フィルターを使用して、受信したアクセストークンを伝播できます。
-
-
FrontendResourceには8つのエンドポイントがあります。-
/frontend/user-name-with-oidc-client-token -
/frontend/admin-name-with-oidc-client-token -
/frontend/user-name-with-oidc-client-token-header-param -
/frontend/admin-name-with-oidc-client-token-header-param -
/frontend/user-name-with-oidc-client-token-header-param-blocking -
/frontend/admin-name-with-oidc-client-token-header-param-blocking -
/frontend/user-name-with-propagated-token -
/frontend/admin-name-with-propagated-token
-
-
When either
/frontend/user-name-with-oidc-client-tokenor/frontend/admin-name-with-oidc-client-tokenendpoint is called,FrontendResourceuses a REST client with an OIDC client filter to get and propagate an access token toProtectedResource. -
When either
/frontend/user-name-with-oidc-client-token-header-paramor/frontend/admin-name-with-oidc-client-token-header-paramendpoint is called,FrontendResourceuses a programmatically created OIDC client to get and propagate an access token toProtectedResourceby passing it to a REST client method as an HTTPAuthorizationheader value. -
When either
/frontend/user-name-with-propagated-tokenor/frontend/admin-name-with-propagated-tokenendpoint is called,FrontendResourceuses a REST client withOIDC Token Propagation Filterto propagate the current incoming access token toProtectedResource. -
ProtectedResourceには2つのエンドポイントがあります。-
/protected/user-name -
/protected/admin-nameどちらのエンドポイントも、
FrontendResourceからProtectedResourceに伝播された受信アクセストークンから抽出したユーザー名を返します。 これらのエンドポイントの唯一の違いは、/protected/user-nameの呼び出しは、現在のアクセストークンにuserロールがある場合にのみ許可され、/protected/admin-nameの呼び出しは、現在のアクセストークンにadminロールがある場合にのみ許可されることです。
-
ソリューション
次のセクションの指示に従って、アプリケーションを段階的に作成することをお勧めします。 ただし、完成した例に直接進むこともできます。
Git リポジトリーをクローンします: git clone https://github.com/quarkusio/quarkus-quickstarts.git 、または アーカイブ をダウンロードします。
ソリューションは security-openid-connect-client-quickstart ディレクトリー にあります。
Maven プロジェクトの作成
以下のコマンドで新規プロジェクトを作成します。
Windowsユーザーの場合:
-
cmdを使用する場合、(バックスラッシュ
\を使用せず、すべてを同じ行に書かないでください)。 -
Powershellを使用する場合は、
-Dパラメータを二重引用符で囲んでください。例:"-DprojectArtifactId=security-openid-connect-client-quickstart"
Maven プロジェクトが生成され、oidc、rest-client-oidc-filter、rest-client-oidc-token-propagation、および rest エクステンションがインポートされます。
すでに Quarkus プロジェクトが設定されている場合は、プロジェクトのベースディレクトリーで以下のコマンドを実行することで、これらのエクステンションをプロジェクトに追加できます。
quarkus extension add oidc,rest-client-oidc-filter,rest-client-oidc-token-propagation,rest
./mvnw quarkus:add-extension -Dextensions='oidc,rest-client-oidc-filter,rest-client-oidc-token-propagation,rest'
./gradlew addExtension --extensions='oidc,rest-client-oidc-filter,rest-client-oidc-token-propagation,rest'
ビルドファイルに次のエクステンションが追加されます。
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-oidc-filter</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-oidc-token-propagation</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest</artifactId>
</dependency>
implementation("io.quarkus:quarkus-oidc,rest-client-oidc-filter,rest-client-oidc-token-propagation,rest")
アプリケーションの記述
-
Implement
ProtectedResource:package org.acme.security.openid.connect.client; import jakarta.annotation.security.RolesAllowed; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import io.quarkus.security.Authenticated; import io.smallrye.mutiny.Uni; import org.eclipse.microprofile.jwt.JsonWebToken; @Path("/protected") @Authenticated public class ProtectedResource { @Inject JsonWebToken principal; @GET @RolesAllowed("user") @Produces("text/plain") @Path("userName") public Uni<String> userName() { return Uni.createFrom().item(principal.getName()); } @GET @RolesAllowed("admin") @Produces("text/plain") @Path("adminName") public Uni<String> adminName() { return Uni.createFrom().item(principal.getName()); } }ProtectedResourceはuserName()とadminName()の両方のメソッドから名前を返します。 この名前は現在のJsonWebTokenから抽出されます。 -
Add the following REST clients:
-
RestClientWithOidcClientFilter:quarkus-rest-client-oidc-filterエクステンションによって提供される OIDC クライアントフィルターを使用して、アクセストークンを取得および伝播します。 -
RestClientWithTokenHeaderParam: これは、プログラムで作成された OidcClient によってすでに取得されたトークンを HTTPAuthorizationヘッダー値として受け入れます。 -
RestClientWithTokenPropagationFilter: これは、quarkus-rest-client-oidc-token-propagationエクステンションによって提供される OIDC トークン伝播フィルターを使用して、アクセストークンを取得および伝播します。
-
-
RestClientWithOidcClientFilterREST クライアントを追加します。package org.acme.security.openid.connect.client; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import io.quarkus.oidc.client.filter.OidcClientFilter; import io.smallrye.mutiny.Uni; @RegisterRestClient @OidcClientFilter (1) @Path("/") public interface RestClientWithOidcClientFilter { @GET @Produces("text/plain") @Path("userName") Uni<String> getUserName(); @GET @Produces("text/plain") @Path("adminName") Uni<String> getAdminName(); }1 REST クライアントに OIDC クライアントフィルターを登録して、トークンを取得および伝播します。 -
RestClientWithTokenHeaderParamREST クライアントを追加します。package org.acme.security.openid.connect.client; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import io.smallrye.mutiny.Uni; import jakarta.ws.rs.GET; import jakarta.ws.rs.HeaderParam; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; @RegisterRestClient @Path("/") public interface RestClientWithTokenHeaderParam { @GET @Produces("text/plain") @Path("userName") Uni<String> getUserName(@HeaderParam("Authorization") String authorization); (1) @GET @Produces("text/plain") @Path("adminName") Uni<String> getAdminName(@HeaderParam("Authorization") String authorization); (1) }1 RestClientWithTokenHeaderParamREST クライアントは、トークンが HTTPAuthorizationヘッダー値として渡されることを想定しています。 -
RestClientWithTokenPropagationFilterREST クライアントを追加します。package org.acme.security.openid.connect.client; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import io.quarkus.oidc.token.propagation.common.AccessToken; import io.smallrye.mutiny.Uni; @RegisterRestClient @AccessToken (1) @Path("/") public interface RestClientWithTokenPropagationFilter { @GET @Produces("text/plain") @Path("userName") Uni<String> getUserName(); @GET @Produces("text/plain") @Path("adminName") Uni<String> getAdminName(); }1 REST クライアントに OIDC トークン伝播フィルターを登録して、既存の受信トークンを伝播します。 Do not use the
RestClientWithOidcClientFilterandRestClientWithTokenPropagationFilterinterfaces in the same REST client because they can conflict, leading to issues.For example, the OIDC client filter can override the token from the OIDC token propagation filter, or the propagation filter might not work correctly if it attempts to propagate a token when none is available, expecting the OIDC client filter to obtain a new token instead.
-
Add
OidcClientCreatorto create an OIDC client programmatically at startup.OidcClientCreatorsupportsRestClientWithTokenHeaderParamREST client calls:package org.acme.security.openid.connect.client; import java.util.Map; import org.eclipse.microprofile.config.inject.ConfigProperty; import io.quarkus.oidc.client.OidcClient; import io.quarkus.oidc.client.OidcClients; import io.quarkus.oidc.client.runtime.OidcClientConfig; import io.quarkus.oidc.client.runtime.OidcClientConfig.Grant.Type; import io.quarkus.runtime.StartupEvent; import io.smallrye.mutiny.Uni; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.event.Observes; import jakarta.inject.Inject; @ApplicationScoped public class OidcClientCreator { @Inject OidcClients oidcClients; (1) @ConfigProperty(name = "quarkus.oidc.auth-server-url") String oidcProviderAddress; private volatile OidcClient oidcClient; public void startup(@Observes StartupEvent event) { createOidcClient().subscribe().with(client -> {oidcClient = client;}); } public OidcClient getOidcClient() { return oidcClient; } private Uni<OidcClient> createOidcClient() { OidcClientConfig cfg = OidcClientConfig .authServerUrl(oidcProviderAddress) .id("myclient") .clientId("backend-service") .credentials("secret") .grant(Type.PASSWORD) .grantOptions("password", Map.of("username", "alice", "password", "alice")) .build(); return oidcClients.newClient(cfg); } }1 OidcClientsを使用して、すでに初期化され、名前が付けられた OIDC クライアントを取得できるほか、必要に応じて新しい OIDC クライアントを作成できます。 -
Finish creating the application by adding
FrontendResource:package org.acme.security.openid.connect.client; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import io.quarkus.oidc.client.Tokens; import io.quarkus.oidc.client.runtime.TokensHelper; import org.eclipse.microprofile.rest.client.inject.RestClient; import io.smallrye.mutiny.Uni; @Path("/frontend") public class FrontendResource { @Inject @RestClient RestClientWithOidcClientFilter restClientWithOidcClientFilter; (1) @Inject @RestClient RestClientWithTokenPropagationFilter restClientWithTokenPropagationFilter; (2) @Inject OidcClientCreator oidcClientCreator; TokensHelper tokenHelper = new TokensHelper(); (3) @Inject @RestClient RestClientWithTokenHeaderParam restClientWithTokenHeaderParam; (4) @GET @Path("user-name-with-oidc-client-token") @Produces("text/plain") public Uni<String> getUserNameWithOidcClientToken() { (1) return restClientWithOidcClientFilter.getUserName(); } @GET @Path("admin-name-with-oidc-client-token") @Produces("text/plain") public Uni<String> getAdminNameWithOidcClientToken() { (1) return restClientWithOidcClientFilter.getAdminName(); } @GET @Path("user-name-with-propagated-token") @Produces("text/plain") public Uni<String> getUserNameWithPropagatedToken() { (2) return restClientWithTokenPropagationFilter.getUserName(); } @GET @Path("admin-name-with-propagated-token") @Produces("text/plain") public Uni<String> getAdminNameWithPropagatedToken() { (2) return restClientWithTokenPropagationFilter.getAdminName(); } @GET @Path("user-name-with-oidc-client-token-header-param") @Produces("text/plain") public Uni<String> getUserNameWithOidcClientTokenHeaderParam() { (4) return tokenHelper.getTokens(oidcClientCreator.getOidcClient()).onItem() .transformToUni(tokens -> restClientWithTokenHeaderParam.getUserName("Bearer " + tokens.getAccessToken())); } @GET @Path("admin-name-with-oidc-client-token-header-param") @Produces("text/plain") public Uni<String> getAdminNameWithOidcClientTokenHeaderParam() { (4) return tokenHelper.getTokens(oidcClientCreator.getOidcClient()).onItem() .transformToUni(tokens -> restClientWithTokenHeaderParam.getAdminName("Bearer " + tokens.getAccessToken())); } @GET @Path("user-name-with-oidc-client-token-header-param-blocking") @Produces("text/plain") public String getUserNameWithOidcClientTokenHeaderParamBlocking() { (5) Tokens tokens = tokenHelper.getTokens(oidcClientCreator.getOidcClient()).await().indefinitely(); return restClientWithTokenHeaderParam.getUserName("Bearer " + tokens.getAccessToken()).await().indefinitely(); } @GET @Path("admin-name-with-oidc-client-token-header-param-blocking") @Produces("text/plain") public String getAdminNameWithOidcClientTokenHeaderParamBlocking() { (5) Tokens tokens = tokenHelper.getTokens(oidcClientCreator.getOidcClient()).await().indefinitely(); return restClientWithTokenHeaderParam.getAdminName("Bearer " + tokens.getAccessToken()).await().indefinitely(); } }1 FrontendResourceは、/frontend/user-name-with-oidc-client-tokenまたは/frontend/admin-name-with-oidc-client-tokenのいずれかが呼び出されたときに、注入されたRestClientWithOidcClientFilterREST クライアントと OIDC クライアントフィルターを使用し、アクセストークンを取得してProtectedResourceに伝播します。2 FrontendResourceは、/frontend/user-name-with-propagated-tokenまたは/frontend/admin-name-with-propagated-tokenのいずれかが呼び出されたときに、注入されたRestClientWithTokenPropagationFilterREST クライアントと OIDC トークン伝播フィルターを使用して、現在の受信アクセストークンをProtectedResourceに伝播します。3 io.quarkus.oidc.client.runtime.TokensHelperis useful when the OIDC client is used directly, without the OIDC client filter. Pass the OIDC client toTokensHelperto get the tokens.TokensHelperacquires the tokens and refreshes them if necessary in a thread-safe way.4 FrontendResourceuses the programmatically created OIDC client to get and propagate an access token toProtectedResourceby passing it directly to the injectedRestClientWithTokenHeaderParamREST client’s method as an HTTPAuthorizationheader value when either/frontend/user-name-with-oidc-client-token-header-paramor/frontend/admin-name-with-oidc-client-token-header-paramis called.5 Sometimes, an application needs to acquire tokens in a blocking manner before propagating them with the REST client. This example shows how to acquire the tokens in such cases. -
Add a Jakarta REST
ExceptionMapper:package org.acme.security.openid.connect.client; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.ClientWebApplicationException; @Provider public class FrontendExceptionMapper implements ExceptionMapper<ClientWebApplicationException> { @Override public Response toResponse(ClientWebApplicationException t) { return Response.status(t.getResponse().getStatus()).build(); } }This exception mapper is only added to verify during the tests that
ProtectedResourcereturns403when the token has no expected role.Without this mapper, Quarkus REST (formerly RESTEasy Reactive) would correctly convert the exceptions that escape from REST client calls to
500to avoid leaking the information from the downstream resources such asProtectedResource. However, in the tests, it would not be possible to assert that500is caused by an authorization exception instead of some internal error.
アプリケーションの設定
コードを準備したら、アプリケーションを設定します。
# Configure OIDC
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus
quarkus.oidc.client-id=backend-service
quarkus.oidc.credentials.secret=secret
# Tell Dev Services for Keycloak to import the realm file
# This property is ineffective when running the application in JVM or Native modes but only in dev and test modes.
quarkus.keycloak.devservices.realm-path=quarkus-realm.json
# Configure OIDC Client
quarkus.oidc-client.auth-server-url=${quarkus.oidc.auth-server-url}
quarkus.oidc-client.client-id=${quarkus.oidc.client-id}
quarkus.oidc-client.credentials.secret=${quarkus.oidc.credentials.secret}
quarkus.oidc-client.grant.type=password
quarkus.oidc-client.grant-options.password.username=alice
quarkus.oidc-client.grant-options.password.password=alice
# Configure REST clients
%prod.port=8080
%dev.port=8080
%test.port=8081
org.acme.security.openid.connect.client.RestClientWithOidcClientFilter/mp-rest/url=http://localhost:${port}/protected
org.acme.security.openid.connect.client.RestClientWithTokenHeaderParam/mp-rest/url=http://localhost:${port}/protected
org.acme.security.openid.connect.client.RestClientWithTokenPropagationFilter/mp-rest/url=http://localhost:${port}/protected
上記の設定は Keycloak を参照します。Keycloak は、受信アクセストークンを検証するために ProtectedResource によって使用され、 password グラントを使用してユーザー alice のトークンを取得するために OidcClient によって使用されます。どちらの REST クライアントも ProtectedResource の HTTP アドレスを指しています。
|
Adding a For more information, see the Running the application in dev mode section. |
Keycloak サーバーの起動と設定
|
Do not start the Keycloak server when you run the application in dev or test modes; For more information, see the Running the application in dev mode section. Ensure you put the realm configuration file on the classpath, in the |
-
Start a Keycloak Server by using Docker:
docker run --name keycloak -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -p 8180:8080 quay.io/keycloak/keycloak:26.5.7 start-devKeycloak サーバーには localhost:8180 からアクセスできます。
-
Keycloak 管理コンソールにアクセスするには、
adminユーザーとしてログインします。パスワードはadminです。 -
Import the realm configuration file to create a new realm.
詳細は、 新規レルムの作成 方法に関する Keycloak ドキュメントを参照してください。
この
quarkusレルムファイルでは、frontendクライアントと、aliceおよびadminユーザーが追加されます。aliceはuserロールを持ち、adminはuserとadminの両方のロールを持ちます。
開発モードでのアプリケーションの実行
-
Run the application in a dev mode:
コマンドラインインタフェースquarkus devMaven./mvnw quarkus:devGradle./gradlew --console=plain quarkusDevKeycloak の Dev Services は Keycloak コンテナーを起動し、
quarkus-realm.jsonをインポートします。 -
/q/dev-ui で入手可能な Dev UI を開き、OpenID Connect Dev UI カードの
Keycloak providerリンクをクリックします。 -
When asked, log in to a
Single Page Applicationprovided by the OpenID Connect Dev UI, log in asadmin, with the password,admin.This user has both
adminanduserroles.-
/frontend/user-name-with-propagated-tokenにアクセスすると、200が返されます。 -
/frontend/admin-name-with-propagated-tokenにアクセスすると、200が返されます。
-
-
Log out and back in as
alicewith the password,alice.This user has a
userrole.-
/frontend/user-name-with-propagated-tokenにアクセスすると、200が返されます。 -
/frontend/admin-name-with-propagated-tokenにアクセスすると、403が返されます。これで、
FrontendResourceが OpenID Connect Dev UI からアクセストークンを伝播できることをテストできました。
-
JVM モードでのアプリケーションの実行
-
After exploring the application in dev mode, run it as a standard Java application by compiling it:
コマンドラインインタフェースquarkus buildMaven./mvnw installGradle./gradlew build -
Run it:
java -jar target/quarkus-app/quarkus-run.jar
ネイティブモードでのアプリケーションの実行
このデモはネイティブコードにコンパイルできます。変更は必要ありません。
これは、生成されたバイナリーにランタイムテクノロジーが含まれ、最小限のリソースで実行するように最適化されているため、実稼働環境に JVM をインストールする必要がなくなることを意味します。
コンパイルには時間がかかるため、この手順はデフォルトでオフになっています。再度ビルドするには、 native プロファイルを有効にします。
quarkus build --native
./mvnw install -Dnative
./gradlew build -Dquarkus.native.enabled=true
しばらくしてビルドが完了すると、ネイティブバイナリーを直接実行できます。
./target/security-openid-connect-quickstart-1.0.0-SNAPSHOT-runner
アプリケーションのテスト
開発モードでのアプリケーションのテストの詳細は、前述のRunning the application in dev mode セクションを参照してください。
curl を使用して、JVM またはネイティブモードで起動したアプリケーションをテストできます。
-
aliceのアクセストークンを取得します。export access_token=$(\ curl --insecure -X POST http://localhost:8180/realms/quarkus/protocol/openid-connect/token \ --user backend-service:secret \ -H 'content-type: application/x-www-form-urlencoded' \ -d 'username=alice&password=alice&grant_type=password' | jq --raw-output '.access_token' \ ) -
このトークンを使用して、
/frontend/user-name-with-propagated-tokenを呼び出します。このコマンドは、200ステータスコードと名前aliceを返します。curl -i -X GET \ http://localhost:8080/frontend/user-name-with-propagated-token \ -H "Authorization: Bearer "$access_token -
同じトークンを使用して
/frontend/admin-name-with-propagated-tokenを呼び出します。前のコマンドとは対照的に、このコマンドはaliceにuserロールしかないため403を返します。curl -i -X GET \ http://localhost:8080/frontend/admin-name-with-propagated-token \ -H "Authorization: Bearer "$access_token -
Obtain an access token for
admin:export access_token=$(\ curl --insecure -X POST http://localhost:8180/realms/quarkus/protocol/openid-connect/token \ --user backend-service:secret \ -H 'content-type: application/x-www-form-urlencoded' \ -d 'username=admin&password=admin&grant_type=password' | jq --raw-output '.access_token' \ ) -
このトークンを使用して
/frontend/user-name-with-propagated-tokenを呼び出します。このコマンドは200ステータスコードと名前adminを返します。curl -i -X GET \ http://localhost:8080/frontend/user-name-with-propagated-token \ -H "Authorization: Bearer "$access_token -
同じトークンを使用して、
/frontend/admin-name-with-propagated-tokenを呼び出します。このコマンドは、adminにuserとadminの両方のロールがあるため、200ステータスコードと名前adminも返します。curl -i -X GET \ http://localhost:8080/frontend/admin-name-with-propagated-token \ -H "Authorization: Bearer "$access_token -
Check the
FrontendResourcemethods, which do not propagate the existing tokens but useOidcClientto get and propagate the tokens.As already shown,
OidcClientis configured to get the tokens for thealiceuser.curl -i -X GET \ http://localhost:8080/frontend/user-name-with-oidc-client-tokenこのコマンドは、
200ステータスコードと名前aliceを返します。curl -i -X GET \ http://localhost:8080/frontend/admin-name-with-oidc-client-token前のコマンドとは対照的に、このコマンドは
403ステータスコードを返します。 -
Test that the programmatically created OIDC client correctly acquires and propagates the token with
RestClientWithTokenHeaderParamboth in reactive and imperative (blocking) modes.-
/user-name-with-oidc-client-token-header-paramを呼び出します。このコマンドは、200ステータスコードと名前aliceを返します:curl -i -X GET \ http://localhost:8080/frontend/user-name-with-oidc-client-token-header-param -
/admin-name-with-oidc-client-token-header-paramを呼び出します。前のコマンドとは対照的に、このコマンドは403ステータスコードを返します:curl -i -X GET \ http://localhost:8080/frontend/admin-name-with-oidc-client-token-header-param
-
-
Test the endpoints that use OIDC client in the blocking mode.
-
/user-name-with-oidc-client-token-header-param-blockingを呼び出します。このコマンドは、200ステータスコードと名前aliceを返します:curl -i -X GET \ http://localhost:8080/frontend/user-name-with-oidc-client-token-header-param-blocking -
/admin-name-with-oidc-client-token-header-param-blockingを呼び出します。前のコマンドとは対照的に、このコマンドは403ステータスコードを返します:curl -i -X GET \ http://localhost:8080/frontend/admin-name-with-oidc-client-token-header-param-blocking
-