跳到主要内容

Github SAML SSO

· 阅读需 2 分钟 ·
Castamere
热爱 Coding

解决 Github SAML SSO 导致无法 clone 代码的问题

Error

Cloning into 'xxx'...

remote: The 'xxx' organization has enabled or enforced SAML SSO.

remote: To access this repository, you must re-authorize the OAuth Application 'Visual Studio Code'.

fatal: unable to access 'xxx': The requested URL returned error: 403

缘起

新公司用 github,拉进 organization 之后,发现本地无法 clone 代码。报错说要重新授权,记录一下

解决方案

首先尝试用 ssh 克隆,但还是失败,但给出了更详细的解决方案:要么用 HTTPS,要么给 SSH 授权

Error

Cloning into 'xxx'...

ERROR: The 'xxx' organization has enabled or enforced SAML SSO.

To access this repository, you must use the HTTPS remote with a personal access token or SSH with an SSH key and passphrase that has been authorized for this organization.

Visit https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/站外链接 for more information.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

跟着它给出的文档,找到了如下的内容:

ref1

继续进一层,找到了如下内容:

ref2

最终解决办法如下:

  1. 访问 Github SSH Settings站外链接
  2. 在此处为对应 SSH 添加 SSO 权限 Authorize
  3. 再回到本地,即可成功 clone
请作者喝可乐🥤:
本文遵循 CC 4.0 BY-SA站外链接 版权协议,转载请标明出处