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

Error messages when a PR is protected by SAML enforcement. #1042

Open
hanefi opened this issue Jun 30, 2022 · 1 comment
Open

Error messages when a PR is protected by SAML enforcement. #1042

hanefi opened this issue Jun 30, 2022 · 1 comment

Comments

@hanefi
Copy link

hanefi commented Jun 30, 2022

Hello,

I opened some PRs on a repo on an org that has SAML enforcements. MicrosoftDocs/azure-docs#94927 Later I started to see some error messages seen below.

image

I copied the error message, formatted it, and opened the link in x-github-sso field on a browser to resolve the issue.

Below is the formatted error message in the screenshot:

Error: Resource protected by organization SAML enforcement. You must grant your Personal Access token access to this organization.:

{
  "response": {
    "data": { "repository": { "pullRequest": null } },
    "errors": [
      {
        "type": "FORBIDDEN",
        "path": ["repository", "pullRequest"],
        "extensions": { "saml_failure": true },
        "locations": [{ "line": 4, "column": 13 }],
        "message": "Resource protected by organization SAML enforcement. You must grant your Personal Access token access to this organization."
      }
    ],
    "status": 200,
    "headers": {
      "map": {
        "content-type": "application/json; charset=utf-8",
        "x-accepted-oauth-scopes": "repo",
        "x-github-media-type": "github.v4; format=json",
        "x-github-request-id": "4DB7:B4C3:6700A9:699AB9:62BD6AC5",
        "x-github-sso": "required; url=https://github.com/enterprises/microsoftopensource/sso?authorization_request=ABTV<redacted>",
        "x-oauth-scopes": "repo",
        "x-ratelimit-limit": "5000",
        "x-ratelimit-remaining": "4913",
        "x-ratelimit-reset": "1656584225",
        "x-ratelimit-resource": "graphql",
        "x-ratelimit-used": "87"
      }
    }
  },
  "request": {
    "query": "\n query {\n repository(owner: \"MicrosoftDocs\", name: \"azure-docs\") {\n pullRequest(number: 94927) {\n reviewDecision\n commits(last: 1) {\n nodes {\n commit {\n statusCheckRollup {\n state\n }\n }\n }\n }\n }\n }\n }\n "
  }
}
@fwouts
Copy link
Owner

fwouts commented Jul 11, 2022

Hi @hanefi, sorry for the delay. Feel free to open a PR to fix this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants