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

Improve messaging when GitHub tokens need SSO authorization #10366

Closed
danepowell opened this issue Dec 17, 2021 · 2 comments · Fixed by #10432
Closed

Improve messaging when GitHub tokens need SSO authorization #10366

danepowell opened this issue Dec 17, 2021 · 2 comments · Fixed by #10432

Comments

@danepowell
Copy link
Contributor

danepowell commented Dec 17, 2021

Composer could be more helpful if you are part of a GitHub organization but forget to enable SSO on your GitHub token. Ideally Composer would detect that SSO is not enabled on the token, or at least mention in the error message somewhere that lack of SSO could be the cause.

Specifically, if the following are true:

  • You are part of a GitHub organization that requires SSO
  • You have configured Composer to use a GitHub token
  • You've not enabled SSO for that token
  • You try to require a package from that organization (even if the package is public)

... then you get an error message:

Could not fetch [package], please review your configured GitHub OAuth token or enter a new one to access private repos

This is especially confusing when trying to download a public package. I know the error message says in part "review your configured token", but it's easy to infer that the token is missing rather than misconfigured. And then go through an endless loop of wondering why a token is even required for a public package, creating and setting a new token, and getting the same error message over and over until you realize the problem is missing SSO.

This might sound a bit like an edge case but I promise you nearly everyone in an SSO org has gone through this at least once (and in my case, multiple times 😄 )

@Seldaek Seldaek added this to the Bugs milestone Dec 19, 2021
@Seldaek
Copy link
Member

Seldaek commented Dec 19, 2021

It would be a lot easier if someone affected would work on a patch for this tbh, because without access to an SSO-enabled org this is going to be a pain to work on.

@danepowell
Copy link
Contributor Author

I proposed a fix in #10432 . I'd appreciate if folks took it for a spin and provided feedback.

@Seldaek Seldaek modified the milestones: Bugs, 2.2 Jan 7, 2022
Seldaek pushed a commit to danepowell/composer that referenced this issue Jan 8, 2022
@Seldaek Seldaek closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants