Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC service applications should be able to accept GitHub tokens #20911

Closed
sberyozkin opened this issue Oct 20, 2021 · 4 comments · Fixed by #29715
Closed

OIDC service applications should be able to accept GitHub tokens #20911

sberyozkin opened this issue Oct 20, 2021 · 4 comments · Fixed by #29715
Labels
area/oidc kind/enhancement New feature or request
Milestone

Comments

@sberyozkin
Copy link
Member

sberyozkin commented Oct 20, 2021

Description

Quarkus OIDC web-app applications can already acquire a GitHub access token and indirectly verify it by requesting a user profile info from GitHub - but if this web-app endpoint propagates this token to the downstream OIDC service endpoint then it will fail since GitHub has no introspection endpoint.
The same would be the case if SPA acquires a GitHub token and sends it to Quarkus.

Implementation ideas

OIDC service applications should indirectly verify GitHub token the same way this token is indirectly verified by web-app applications - by requesting some user info profile data via a configured GitHub userinfo endpoint.

In fact, I've realized now - it will solve similar issues with many other non Keycloak providers like for ex Auth0 or Google where the access token is binary but no introspection endpoint is provided - for ex - Auth0 binary access tokens sent by OIDC DevUI will always return 401 (as opposed to JWT ID tokens which can be verified by JWKs).

@sberyozkin sberyozkin added the kind/enhancement New feature or request label Oct 20, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 20, 2021

/cc @pedroigor

@sberyozkin
Copy link
Member Author

CC @gastaldi

@gsmet
Copy link
Member

gsmet commented Jan 4, 2022

@sberyozkin wouldn't this one be fixed by your ongoing PR? Or maybe already fixed?

@sberyozkin
Copy link
Member Author

sberyozkin commented Mar 30, 2022

@gsmet Apologies, going through the list and finding I've missed a few comments.

Unfortunately not; GitHub is not an OpenId Connect provider, so with the Quarkus OIDC web-app applications (when the user is redirected to GitHub to authenticate) we make a few workarounds to treat it as if it were the OIDC provider, specifically, with the standard code flow the signed IdToken and access token must be returned, GitHub does not return IdToken - so the question is how to verify the user authentication has been successful - since even the GitHub access token is not signed - just a binary blob. So the way we do it we ensure that this access token can be used to fetch a UserInfo - as it will involve GitHub verifying this access token on our behalf.

So that works for web-app only for now.

For the bearer tokens, those coming with HTTP Authorization, we are again dealing with the binary access tokens. We can't verify them locally with the OIDC keys - GitHub does not provide any public ones, and we can't introspect - since GitHub has no introspection endpoint. So the question, how can we allow this request to proceed. I think we'd need to allow the same as for web-app applications - indirect verification via the UserInfo acquisition.

michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 6, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 6, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 6, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 7, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 7, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 7, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 7, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Dec 8, 2022
@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oidc kind/enhancement New feature or request
Projects
None yet
2 participants