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

fix: use device code auth when running in a web browser #5062

Merged
merged 1 commit into from
May 29, 2024

Conversation

jpinkney-aws
Copy link
Contributor

@jpinkney-aws jpinkney-aws commented May 28, 2024

Problem

  • Logging into the toolkit using the authorization grant flow in code server/openshift dev spaces does not fully work. This is because the authorization grant page is being served from the backend compute and the browser is unable to access it

Solution

  • Disable the authorization grant flow when you are running in a web browser

Extra notes:

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jpinkney-aws jpinkney-aws requested a review from a team as a code owner May 28, 2024 19:50
Problem:
- Logging into the toolkit using the authorization grant flow in code server/openshift dev spaces does not fully work. This is because the authorization grant page is being served from the backend compute and the browser is unable to access it

Solution:
- Disable the authorization grant flow when you are running in a web browser

Extra notes:
- It was done this way rather than relying on vscode.env.remoteName because remoteName can change with different remote instances. e.g. openshift dev spaces assigns a remoteName that is unique to each workspace
- VSCode itself disables remote extension hosts and web workers for this flow: https://github.com/microsoft/vscode/blob/main/extensions/github-authentication/src/flows.ts#L210
@justinmk3 justinmk3 merged commit 51cd368 into master May 29, 2024
14 checks passed
@justinmk3 justinmk3 deleted the jpinkney-aws/auth-grant-web branch May 29, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants