OIDC Token Propagation with Google #34289
-
Hello, I'm building a simple example API and Application, with a "WhoAmIResource" (API) returning only the user basic info (isAnonymous, name, ...) and a "WhoAmIClient" (APP) on the client side consuming that. Using only google as the identity provider. From the API side, using bearer token, everything seem to authenticate and work fine. From the APP side (Vaadin), the rest client gest inject but does not work properly. The invocation is made without the authentication header and no method on the injected accessToken responds. Here is the code in question...
In the UI:
In the rest client
Is there any tutorial, example or content around this, other than the official docs? |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 2 replies
-
/cc @pedroigor (oidc), @sberyozkin (oidc) |
Beta Was this translation helpful? Give feedback.
-
Hi @faermanj https://quarkus.io/guides/security-openid-connect-client-reference#token-propagation-reactive shows how to do it:
No need to have the custom client header factory, it is probably interfering. |
Beta Was this translation helpful? Give feedback.
-
I will try to prioritize on #33053 and add the propagation note. It will be linked to from https://quarkus.io/guides/security-openid-connect-providers#google as well |
Beta Was this translation helpful? Give feedback.
-
@faermanj By the way, you mentioned the bearer token is verified, can I ask you how you configured Quarkus to make it happening ? The problem with Google bearer tokens they are binary tokens and Google offers no introspection endpoint so it has to be verified via the user info acquisition - |
Beta Was this translation helpful? Give feedback.
-
Can you also please create a simple reproducer ? I'm surprised that you have |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot @sberyozkin i'll look into the references you posted |
Beta Was this translation helpful? Give feedback.
-
Here's a PR with only this OIDC "who am I" demo with API and APP projects, using google for auth. One thing I'm not quite sure is how to declare that "/user/" is for authenticated users (any role) and / is public.
Current status: @sberyozkin Added your gmail address to google test users, thanks a lot for helping out |
Beta Was this translation helpful? Give feedback.
-
@faermanj Thanks, As far as qpizza-app is concerned, here are the changes I've done just to narrow down the problem as well as do some minor cleanup:
First, since you'd like to propagate the tokens, as opposed to produce them, you need I've also left only a permission policy requiring that And you don't need Indeed, if I access |
Beta Was this translation helpful? Give feedback.
-
@faermanj It may well be the only problem that you have in this reproducer is that you don't have a |
Beta Was this translation helpful? Give feedback.
-
@sberyozkin thank you very much, that did it! |
Beta Was this translation helpful? Give feedback.
-
@sberyozkin next up i'll try to implement Amazon Cognito authentication too... let's see how that goes :) Also, I'll be recording this as an episode of the show, anything you'd suggest people should know/read before implementing OIDC with Quarkus? |
Beta Was this translation helpful? Give feedback.
-
Hey @faermanj Thanks for the tweet, I realized I did not get back here with some more info.
HTH |
Beta Was this translation helpful? Give feedback.
@faermanj Thanks,
As far as qpizza-app is concerned, here are the changes I've done just to narrow down the problem as well as do some minor cleanup: