You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how to fix "Resource protected by organization SAML enforcement" #2661
What is required is re-authentication, but it would be a good idea to cover this in a FAQ entry:
$ gh auth login
? What account do you want to log into? GitHub.com
- Logging into github.com
? You're already logged into github.com as XXX. Do you want to re-authenticate? Yes
Or maybe just tell the user to run gh auth login when the command fails with that error.
Reacted by Scott Pelak, Aubrey Portwood, Andrew Arnott, Viliam Durina, Subesokun, Franz Ternus, Zsolt Donca, Carlo Cardella, Philipp Süß, Theron Voran and 149 more
Reacted by Luke Kysow, Jeff Escalante, Aditi Mishra, Tariq, Fernando Mercês, Adeel Ahmad, Ariel Mirra, Leif Lundberg, Paul Clark, Patrik Sundbäck and 51 more
Reacted by Benjohn Barnes, Ankur Agarwal, uiTravis, Nir Yosef, bfrisbie-wiz, ahmad-alsermany, Cláudio Castro, Thomas Bakken Moe, Arda Örkin, Walt Ribeiro and 5 more
Thankfully google took me here so this issue already acts as a FAQ entry.
Reacted by Nate Smith, Ty Mick, Zsolt Donca, Philipp Süß, Theron Voran, Andy Waite, Luke Kysow, Johannes Schindelin, Aditi Mishra, Gareth Western and 66 more
I have a service connection between Azure DevOps and GitHub for the pipelines to communicate with. It isn't possible to have the user re-authorize with a command. How do I fix the service connection to be re-authorized so when the pipeline is triggered it doesn't need this?
Reacted by Sam Purtill, Shachar Ashkenazi, Declan Coughlan, JD and Jamie
Thanks for the solution. @mislav I'm not sure why this issue is closed, since I just got the error and didn't get any suggestions of what to do.
In fact the behavior was misleading: I got a link to authorize in my browser, followed the authorization, but continued to get an error. Only gh auth login fixed it.
for posterity, I'm explicitly linking this back to #5054 where the original solution was reworked to give users direction to authorize the organization associated with the PAT within the web browser:
@zyrain : Please create a new issue including terminal commands, output, gh version, and any verbose / debug information so we can triage and prioritize! ❤
This should not be closed yet, as you still get this error without any hint to use gh auth login or gh auth refresh. But thanks, at least Google is helpful to guide us to this (unresolved) issue.
I totally agree that this should be reopened. While I get the message and use the browser to "authorize", it has no effect on gh cli. Even running gh auth refresh does nothing. In the browser I can access the repo, but not from gh cli.
Update: I was able to address this by going to my ssh key settings and enabling SSO access for it, something that the current error message does not say. I assume it assumes that you tried HTTP token approach, which was not the case.
Activity
viliam-durina commentedon Feb 17, 2021
Thankfully google took me here so this issue already acts as a FAQ entry.
leiflundberg commentedon Aug 25, 2021
Bumping this as it fixed my problem 👍🏼
imonkia commentedon Jan 13, 2023
This was super helpful. Spent an unnecessary amount of time trying to "fix" this "issue". Thanks!
AnkurAgarwal-ST commentedon May 2, 2023
Super helpful, fixed my issue immediately.
rkaurSFDX commentedon Jul 27, 2023
Fixed my issue as well, thanks a ton!
D99013682 commentedon Sep 26, 2023
I have a service connection between Azure DevOps and GitHub for the pipelines to communicate with. It isn't possible to have the user re-authorize with a command. How do I fix the service connection to be re-authorized so when the pipeline is triggered it doesn't need this?
ffisc commentedon Dec 20, 2023
Thanks for the solution.
@mislav I'm not sure why this issue is closed, since I just got the error and didn't get any suggestions of what to do.
In fact the behavior was misleading: I got a link to authorize in my browser, followed the authorization, but continued to get an error. Only
gh auth loginfixed it.zyrain commentedon Mar 14, 2024
This is not fixed. Re-open please.
andyfeller commentedon Jun 7, 2024
for posterity, I'm explicitly linking this back to #5054 where the original solution was reworked to give users direction to authorize the organization associated with the PAT within the web browser:
cli/cmd/gh/main.go
Lines 158 to 166 in 6f558c9
andyfeller commentedon Jun 7, 2024
@zyrain : Please create a new issue including terminal commands, output,
ghversion, and any verbose / debug information so we can triage and prioritize! ❤bigben79 commentedon Nov 25, 2024
Fixed my issue as well 👍
berenar commentedon Feb 21, 2025
Thanks 🚀
KoalaBear84 commentedon May 1, 2025
This should not be closed yet, as you still get this error without any hint to use
gh auth loginorgh auth refresh. But thanks, at least Google is helpful to guide us to this (unresolved) issue.ssbarnea commentedon Aug 27, 2025
I totally agree that this should be reopened. While I get the message and use the browser to "authorize", it has no effect on gh cli. Even running
gh auth refreshdoes nothing. In the browser I can access the repo, but not from gh cli.Does anyone have other hints?
ssbarnea commentedon Aug 27, 2025
Update: I was able to address this by going to my ssh key settings and enabling SSO access for it, something that the current error message does not say. I assume it assumes that you tried HTTP token approach, which was not the case.