Issues with GitHub OIDC flow and ID token introspection (3.15.1) #43545
-
I want to implement a simple web app running on localhost:8080 to authenticate with GitHub. I read the guides https://quarkus.io/guides/security-oidc-code-flow-authentication and the specifics for GitHub https://quarkus.io/guides/security-openid-connect-providers#github, but I keep receiving a 401 after authentication (which seems to work fine). Here's the config:
The user navigates in browser to http://localhost:8080, logs in via http://localhost:8080/login/github and is redirected to the GitHub login page. After successful authentication, the browser is redirected back to http://localhost:8080/signed-in with code and state query params: http://localhost:8080/signed-in?code=xxx&state=0c230eb0-ebde-480c-a8e9-7ada2a8d23df this triggers a 401 in quarkus. DEBUG logs outputs the following:
What am I missing here? I also tried id-token-required=false and other related properties, but no avail. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 15 replies
-
/cc @pedroigor (oidc), @sberyozkin (oidc) |
Beta Was this translation helpful? Give feedback.
-
@dergreg Hi, I'm pretty sure I've reproduced the problem. Do you have
in the code ? The problem here is that it injects an access token, since no You just need to remove this injection and all should be good. Do you need to use Github access token to access Github API ? You only need to add Let me know if the above helps |
Beta Was this translation helpful? Give feedback.
@dergreg Hi, I'm pretty sure I've reproduced the problem.
Do you have
in the code ? The problem here is that it injects an access token, since no
@IdToken
qualifier is present, while Github access tokens are opaque/binary. The problem you are seeing occurring even before the injection itself would fail, when Quarkus sees access token injections in the JWT format, it enforces the access token verification, in addition to the mandatory ID token verification.You just need to remove this injection and all should be good. Do you need to use Github access token to access Github API ? You only need to add
@AccessToken
to the REST client and Quarkus will propagate it f…