Replies: 3 comments 5 replies
-
@adziri Hi Can you check what is sent in the refresh token grant, see: Also, while it is unlikely to be related, |
Beta Was this translation helpful? Give feedback.
-
Sorry, I meant to say Quarkus does itself, you don't need to append it. So just remove the introspection path property.
These are the authorization code flow parameters, but your stacktrace says you have the refresh grant in action
May be because ID token is valid ? Maybe you can create a simple reproducer ? |
Beta Was this translation helpful? Give feedback.
-
@adziri Lets see what we can do. First, I think you should give it a try and update the platform to use one of the recent Quarkus versions. Clearly something does not work in the 2.14.2 based solution - but there is no way to get it fixed, there will be no next 2.14.x release. For example, the latest stacktrace shows ID token is not refreshed If the refresh token grant does not return an ID token (as would be the case with the OAuth2 providers). As you can see, in the 3.8 case, if the ID token is internal (i.e, generated by Quarkus when no ID token is returned by the OAuth provider), Quarkus regenerates it - but it does not happen in the 2.14.2 case. So please update your provider to the latest Quarkus and then we can see what works and what has to be fixed |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using quarkus oidc for authentication. Our idp generates tokens with short validity (5min). So I'm using the following configuration to refresh the access token. I can see in the logs that it's refreshed successfully every 3min ( 2min before expiration).
`quarkus.oidc.application-type=web-app
quarkus.oidc.auth-server-url=https://idp.url.com
quarkus.oidc.introspection-path=.well-known/openid-configuration
quarkus.oidc.client-id=[client-id]
quarkus.oidc.credentials.secret=[secret]
quarkus.oidc.authentication.scopes=openid,profile,groups
quarkus.oidc.authentication.redirect-path=/callback
quarkus.oidc.authentication.restore-path-after-redirect=true
quarkus.oidc.authentication.pkce-required=true
quarkus.oidc.authentication.id-token-required=false
quarkus.oidc.authentication.user-info-required=true
quarkus.oidc.token.refresh-expired=true
quarkus.oidc.token.refresh-token-time-skew=2m
quarkus.http.auth.permission.authenticated1.paths=/*
quarkus.http.auth.permission.authenticated1.methods=GET,POST,PUT,DELETE
quarkus.http.auth.permission.authenticated1.policy=authenticated`
However, when I trigger an asynchronous service call , I got the following exception. Even though, the token continue to be refreshed successfully. Any idea please ?
2024-03-07 17:54:59.748 ERROR [vert.x-eventloop-thread-0,] i.q.v.h.r.QuarkusErrorHandler:127 - HTTP Request to /service/api?path=import&async=true failed, error id: 1234: io.quarkus.oidc.OIDCException: {"error_description":"unknown, invalid, or expired refresh token","error":"invalid_grant"} at io.quarkus.oidc.runtime.OidcProviderClient.responseException(OidcProviderClient.java:204) at io.quarkus.oidc.runtime.OidcProviderClient.getJsonObject(OidcProviderClient.java:188) at io.quarkus.oidc.runtime.OidcProviderClient.getAuthorizationCodeTokens(OidcProviderClient.java:168) at io.quarkus.oidc.runtime.OidcProviderClient.lambda$refreshAuthorizationCodeTokens$4(OidcProviderClient.java:124) at io.smallrye.context.impl.wrappers.SlowContextualFunction.apply(SlowContextualFunction.java:21) at io.smallrye.mutiny.operators.uni.UniOnItemTransform$UniOnItemTransformProcessor.onItem(UniOnItemTransform.java:36) at io.smallrye.mutiny.operators.uni.UniOperatorProcessor.onItem(UniOperatorProcessor.java:47) at io.smallrye.mutiny.operators.uni.UniOperatorProcessor.onItem(UniOperatorProcessor.java:47) at io.smallrye.mutiny.vertx.AsyncResultUni.lambda$subscribe$1(AsyncResultUni.java:35) at io.smallrye.mutiny.vertx.DelegatingHandler.handle(DelegatingHandler.java:25) at io.vertx.ext.web.client.impl.HttpContext.handleDispatchResponse(HttpContext.java:397) at io.vertx.ext.web.client.impl.HttpContext.execute(HttpContext.java:384) at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:362) at io.vertx.ext.web.client.impl.HttpContext.fire(HttpContext.java:329) at io.vertx.ext.web.client.impl.HttpContext.dispatchResponse(HttpContext.java:291) at io.vertx.ext.web.client.impl.HttpContext.lambda$null$7(HttpContext.java:507) at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264) at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:246) at io.vertx.core.impl.EventLoopContext.lambda$runOnContext$0(EventLoopContext.java:43) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:829)
Beta Was this translation helpful? Give feedback.
All reactions