-
Notifications
You must be signed in to change notification settings - Fork 22
gh net
crashes when token must be authorized for SSO
#61
Comments
Found a workaround. In the codespace do the following:
Now it's possible to connect using |
Ideally the local |
This is an old issue in GH CLI itself - it tries to use existing token for public repos which is failing in some cases. Related issue: cli/cli#6675 |
The workaround could be to use the local session to download the gh-net resources, instead of having the codespace do it. In case of That way the Oauth prompt and authorization can be handled locally. Or the ssh session could wait for the token to be authorized, cause GitHub does send the url to authorize the token, or will it still not work after authorization? It could also unset the github_token environment variable on the codespace prior to trying to download the extension, that worked for me. I couldn't find the sources for gh-net, but it looks like it remotely runs a shell on codespaces to invoke the download if the release stuff. That looks like it could control the contents of the token prior to invitation... Ideally though, gh-net wouldn't crash and would relay the error message properly. |
Describe the bug
when running
gh net
the cli is trying to download the latest release from the github/gh-net repo. To do so it passes the access token that thegh auth login
got or the token in theGH_TOKEN
environmnent variable.That token must be authorized by SSO, if you're a member of the github org on github. Which I now am.
This crashes the
gh-net
extensionReproduce steps
Steps to reproduce the behavior:
Be signed in on your
personal
account that's also a member of the github org (I'm a contractor)set the environment variable
GH_TOKEN
with a valid github token. Authorize the token on the Github org using the tokenConfigure SSO
option.run
gh net
Select the codespace
Expected behavior
The ssh tunnel is setup correctly
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Setting a full-scope PAT that's SSO-enabled still won't work. It either throws the above error or this one:
The text was updated successfully, but these errors were encountered: