Unhandled exception. Octokit.ForbiddenException: Resource protected by organization SAML enforcement. You must grant your OAuth token access to this organization.
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- csharp, github
- 领域
- authentication, cli
调研方向
从 Microsoft.WingetCreateCore.Common.GitHub.CheckAccess 和 Microsoft.WingetCreateCLI.Commands.BaseCommand.LoadGitHubClient 开始,使用报告中描述的 token 命令流程。检查 wingetcreate info 显示的用户设置路径,并重现 SAML 失败;当可以在没有未处理异常的情况下完成 token 清除和登录时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Brief description of your issue
Today when I want to use WinGetCreate to create a manifest, I was told that:
Token was invalid. Please generate a new GitHub token and try again.
So I ran wingetcreate token --store and signed into GitHub in the browser. It seemed succeeded, however, after that I got the following error message when running any command, even including wingetcreate token --clear and wingetcreate token --store:
Unhandled exception. Octokit.ForbiddenException: Resource protected by organization SAML enforcement. You must grant your OAuth token access to this organization.
at Octokit.Connection.HandleErrors(IResponse response) in /_/Octokit/Http/Connection.cs:line 785
at Octokit.Connection.RunRequest(IRequest request, CancellationToken cancellationToken, Func`2 preprocessResponseBody) in /_/Octokit/Http/Connection.cs:line 766
at Octokit.Connection.Run[T](IRequest request, CancellationToken cancellationToken, Func`2 preprocessResponseBody) in /_/Octokit/Http/Connection.cs:line 751
at Octokit.ApiConnection.Get[T](Uri uri, IDictionary`2 parameters)
at Microsoft.WingetCreateCore.Common.GitHub.CheckAccess()
at Microsoft.WingetCreateCLI.Commands.BaseCommand.CheckGitHubTokenAndSetClient()
at Microsoft.WingetCreateCLI.Commands.BaseCommand.LoadGitHubClient(Boolean requireToken)
at Microsoft.WingetCreateCLI.Program.Main(String[] args)
at Microsoft.WingetCreateCLI.Program.<Main>(String[] args)
{"message":"Resource protected by organization SAML enforcement. You must grant your OAuth token access to this organization.","documentation_url":"https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/","status":"403"}
I don't know which step during the login was wrong, but now I could not even clear the access token. I remember there was a step to authorize my organization and I ignored it, but I don't know how to redo it now. I even tried to reinstall WinGetCreate but the token seemed not cleared, either.
If there is any other way to clear the token or sign in again please tell me, thanks.
Steps to reproduce
As above.
Expected behavior
Successfully stored the access token and access the GitHub repositories.
Actual behavior
As shown in the description.
Environment
> wingetcreate info
Windows Package Manager Manifest Creator v1.10.3.0
Copyright (c) Microsoft Corporation. All rights reserved.
Operating System: Microsoft Windows NT 10.0.26200.0
System Architecture: X64
Winget-Create Directories Path
------------------------------------------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.WindowsPackageManagerManifestCreator_8wekyb3d8bbwe\LocalState\DiagOutputDir
User settings %LOCALAPPDATA%\Packages\Microsoft.WindowsPackageManagerManifestCreator_8wekyb3d8bbwe\LocalState\settings.json
Installer cache %TEMP%\wingetcreate
Links
------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-create-privacy
License Agreement https://aka.ms/winget-create-license
Third Party Notices https://aka.ms/winget-create-3rdPartyNotice
Homepage https://aka.ms/winget-create
- 主要语言
- C#
- 星标
- 651
- 派生
- 114
- 平均合并
- 10 小时 37 分钟
- 30 天内合并 PR
- 2
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/winget-create 的其他 Issue
-
Issue-Docs Needs-Triage
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/winget-create#705 ·
-
Issue-Feature Needs-Triage
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/winget-create#680 ·
-
Needs-Triage
难度 3/5 1-2 天 新手友好度 68/100
microsoft/winget-create#706 ·
-
Issue-Feature Needs-Triage
难度 4/5 3-5 天 新手友好度 52/100
microsoft/winget-create#701 ·
-
Issue-Feature Needs-Triage
难度 3/5 1-2 天 新手友好度 68/100
microsoft/winget-create#700 ·
查看 microsoft/winget-create 的全部 Issue
相似的 Issue
-
[Simple] NavigationBar primary commands do not render AppBarButton.Content when it is a UIElement未关闭control/navigationbar kind/bug triage/untriaged
难度 2/5 1-3 小时 新手友好度 90/100
unoplatform/uno.toolkit.ui#1652 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
microsoft/copilot-camp#1053 ·
维护者通常 1 天内回复
-
bug effort:S P3
难度 2/5 1-3 小时 新手友好度 84/100
nightscout/nocturne#1861 ·
维护者通常 1 天内回复
-
agentic-workflows area/Docs partner/agentic-workflows
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/fluentui-blazor#5364 ·
维护者通常 1 天内回复