-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
GitHub Authentication provider returns a different token type when connected to a CodeSpace in a browser #185915
Comments
Yeah this is expected. In the web, Codespaces supplies tokens from their GitHub App ahead of time, that are used by the extensions that we wanted to be already logged in when the Codespace loads. Any additional requests go through the OAuth flow. Can I ask what behavior difference you're seeing that's causing you issues? |
For us specifically, the Static Web Apps service isn't compatible with the GitHub App tokens. I think the weirdest part is that we're requesting a token with OAuth-specific scopes and we receive a GitHub App token with unknown scopes. Our current workaround is to make another |
I'm not sure what I can do from the auth extension perspective. We likely need to figure out a way to get the SWA extension to play nice with the GitHub App tokens available in Codespaces... |
This isn't something in our control. I think the SWA team needs to allow Codespaces GH Apps tokens. |
Does this issue occur when all extensions are disabled?: No, issue with extension
In a browser connected to a CodeSpace we receive "GitHub App user-to-server tokens" (prefixed with
ghu_
). In all other places I tested, we receive "OAuth access tokens" (prefixed bygho_
) 1. The user-to-server tokens are created by GitHub Apps, whereas OAuth tokens are created by OAuth apps 2.This causes issues because the tokens behave quite differently and have different, unique scoping systems. Also, if you try to request a new token with a user-to-server token (
ghu
) specific scope, the auth provider returns agho
token.Steps to Reproduce:
It's easiest to reproduce this issue by using the Fugio extension.
repo workflow user:email read:user
Footnotes
GitHub authentication token formats: https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/ ↩
Differences between GitHub Apps and OAuth apps https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps ↩
The text was updated successfully, but these errors were encountered: