Reputation: 33
I have implemented a backend call protected via bearer authentication to the Keycloak's userinfo endpoint using access token in vert.x framework. I am able to run this code without any errors. But I am getting this warning:
> May 16, 2022 10:33:04 AM
io.vertx.ext.auth.oauth2.impl.OAuth2AuthProviderImpl WARNING: Skipped
> unsupported JWK: java.security.NoSuchAlgorithmException: RSA-OAEP
Below is the code:
> 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 are as follows:
> <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>
How to resolve this warning?
Upvotes: 1
Views: 751
Reputation: 3747
As this now throws a RuntimeException
you might want to disable the key provider:
Realm settings > Keys > Providers
rsa-enc-generated
: switch enabled
and active
to offIn one instance, rsa-enc-generated
was already set to disabled/deactivated. When I set it on and off again and hit the save button, the provider is actually disabled and the error disappears. But in a later instance it was correctly shown as enabled/active and I had to disable it to fix the error.
Upvotes: 2