我在vert.x框架中使用访问令牌实现了一个后端调用,该调用通过对Keycloak的userinfo端点的承载者身份验证进行保护。我可以运行这个代码没有任何错误。但我得到了这个警告:
> May 16, 2022 10:33:04 AM
io.vertx.ext.auth.oauth2.impl.OAuth2AuthProviderImpl WARNING: Skipped
> unsupported JWK: java.security.NoSuchAlgorithmException: RSA-OAEP
下面是代码:
> OAuth2ClientOptions clientOptions = new OAuth2ClientOptions()
> .setFlow(OAuth2FlowType.AUTH_CODE)
> .setSite(System.getProperty("oauth2.issuer", "http://localhost:8080/auth/realms/myrealm"))
> .setClientID(System.getProperty("oauth2.client_id", "myclientid"))
> .setClientSecret(System.getProperty("oauth2.client_secret",
> "myclientscret"));
>
> private Handler<RoutingContext> UserInfo(WebClient webClient, String
> userInfoUrl) {
>
> return (RoutingContext ctx) -> {
>
> OAuth2TokenImpl user = (OAuth2TokenImpl) ctx.user();
>
> URI userInfoEndpointUri = URI.create(userInfoUrl);
> webClient
> .get(userInfoEndpointUri.getPort(), userInfoEndpointUri.getHost(), userInfoEndpointUri.getPath())
> .bearerTokenAuthentication(user.opaqueAccessToken())
> .as(BodyCodec.jsonObject())
> .send(ar -> {
> JsonObject body = ar.result().body();
> respondWithOk(ctx, "application/json", body.encodePrettily());
> });
> };
> }
相关性如下:
> <dependencies>
> <dependency>
> <groupId>io.vertx</groupId>
> <artifactId>vertx-auth-oauth2</artifactId>
> <version>3.9.1</version>
> </dependency>
> <dependency>
> <groupId>io.vertx</groupId>
> <artifactId>vertx-core</artifactId>
> <version>3.9.1</version>
> </dependency>
> <dependency>
> <groupId>io.vertx</groupId>
> <artifactId>vertx-web</artifactId>
> <version>3.9.1</version>
> </dependency>
> <dependency>
> <groupId>io.vertx</groupId>
> <artifactId>vertx-web-client</artifactId>
> <version>3.9.1</version>
> </dependency>
> <dependency>
> <groupId>io.vertx</groupId>
> <artifactId>vertx-auth-jwt</artifactId>
> <version>3.9.1</version>
> </dependency>
> </dependencies>
如何解决此警告?
2条答案
按热度按时间mkshixfv1#
您可以忽略此警告,它是just a warning on purpose。
dxpyg8gm2#
由于现在抛出了一个
RuntimeException
,你可能想禁用密钥提供程序:Realm settings > Keys > Provider
rsa-enc-generated
:禁用和停用rsa-enc-generated
已经设置为禁用/停用,但当我再次将其设置为打开和关闭并点击保存按钮时,提供程序实际上被禁用,错误消失。*