Skip to content

Document how to fix "Resource protected by organization SAML enforcement" #2661

@hoxu

Description

@hoxu

When an organization enables SAML enforcement, gh starts giving the following error:

$ gh pr create ...
GraphQL error: Resource protected by organization SAML enforcement. You must grant your OAuth token access to this organization.

This is confusing, because if you check your https://github.com/settings/tokens page, the gh token is not there, so it's not immediately obvious what the user should do.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIpriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions