GitHub: "Resource protected by organization SAML enforcement"
The organization signs in through SAML single sign-on (SSO), and the token has not been authorized for it. In GitHub's words, a personal access token (classic) must be authorized after creation before it can access an organization that uses SAML SSO. The token's scopes are not the problem: authorize the same token for the organization, then try again.
The whole answer
A real one (from a public report):
HTTP 403
{"message": "Resource protected by organization SAML enforcement. You must grant your Personal Access token access to this organization.",
"documentation_url": "https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/",
"status": "403"}
From GitHub's Authenticating to the REST API: with a 403, the X-GitHub-SSO header includes a URL that you can follow to authorize the token, and the URL expires after one hour. It looks like this (from another report):
X-GitHub-SSO: required; url=https://github.com/orgs/ORG/sso?authorization_request=...
Two more answers from the same page: GitHub may answer 404 Not Found instead of 403; and a call that covers several organizations leaves out the results from the organizations that require the authorization, with the header X-GitHub-SSO: partial-results; organizations=21955855,20582480 naming them by ID. To see the header, call the address that failed with curl:
curl -i -H "Authorization: Bearer your-token" "https://api.github.com/the/address/that/failed"
To find where to authorize the token: Pull Request Inbox for GitHub, a plugin for JetBrains IDEs, says on a 403 with the X-GitHub-SSO header that the organization signs in with SAML single sign-on, and shows the authorization address from the header.
Authorize the token
From GitHub's Authorizing a personal access token for use with single sign-on:
- Your profile picture, Settings, Developer settings, Personal access tokens (the classic tokens).
- Next to the token, Configure SSO.
- In the dropdown menu, Authorize to the right of the organization.
Or follow the URL from the header within the hour. The token stays the same, so nothing needs to change where it is stored.
- No Configure SSO: a token can only be authorized once you have a linked external identity. Sign in to the organization through its identity provider (IdP) at least once, then look again.
- Linked the wrong identity: if a member links the wrong identity to their GitHub account, an organization owner can revoke the linked identity so the member can try again: People, the member's name, SAML identity linked, then Revoke to the right of the identity. In an organization that uses SCIM, revoking it on GitHub also removes the SAML and SCIM metadata, so the IdP can no longer synchronize the identity; an admin revokes it through the IdP instead (viewing and revoking a linked identity).
- The identity is linked to another account: signing in with an external identity that is already linked to another GitHub account gives an error that you cannot sign in with that identity, for example when you use a new GitHub account in the organization. If you did not mean to use that identity with this account, sign out of the identity and sign in through SSO again; if you did, ask your administrator to unlink the identity from the old account so it can be linked to the new one (linked external identities).
- IP allow list: if the organization belongs to an enterprise with both an IP allow list and single sign-on at the enterprise level, your IP address must also be allowed at the enterprise level.
- It worked before: the authorization ends when an organization or enterprise owner revokes it, when you are removed from the organization, when the token's scopes are edited or the token is regenerated, and when the token expires. Authorize it again.
- What an owner sees: under Authorized credentials, an owner sees each personal access token and SSH key a member has authorized, with only the last several characters visible. Revoking one there removes only the SAML authorization; the token or key itself is not deleted (authorized credentials for a single member).
- From the REST API, for owners:
GET /orgs/ORG/credential-authorizations?login=LOGINlists the personal access tokens, SSH keys, OAuth app tokens and GitHub App user-to-server tokens a member has authorized, with fields such ascredential_type,token_last_eight,credential_authorized_atandcredential_accessed_at. Only an organization owner can call it, and classic tokens and OAuth app tokens need theread:orgscope (List SAML SSO authorizations for an organization).DELETE /orgs/ORG/credential-authorizations/CREDENTIAL_IDremoves one with 204 No Content and needsadmin:org; the person then authorizes the credential again (Remove a SAML SSO authorization for an organization). - SSO not enforced: once you have a linked identity for an organization, only authorized tokens and SSH keys work with it, even if SSO is not enforced.
- Git over SSH: an SSH key needs the same authorization. In Settings, SSH and GPG keys, click Configure SSO next to the key, then Authorize next to the organization. If the organization revokes the key's authorization, the same key cannot be authorized again; create a new key and authorize that one. SSH certificates signed by the organization's SSH certificate authority need no authorization (authorizing an SSH key for use with single sign-on).
- Signed in through an app: when you sign in to an OAuth app or a GitHub App, its token is authorized for the organizations you had an SSO session with at that moment, as long as the app is allowed there. If it cannot reach the organization, check that the app is approved or installed for it, then open single sign-on settings, click Sign in next to the organization, and sign in to the app again (authorizing an app for single sign-on). After an owner enables or enforces SSO and you authenticate through it for the first time, apps you had authorized before must be authorized again (about OAuth apps, GitHub Apps, and SSO).
- The GitHub CLI's token: a request made with the token the GitHub CLI stored can be refused with
remote: The 'ORG' organization has enabled or enforced SAML SSO.remote: To access this repository, you must re-authorize the OAuth Application 'GitHub CLI'., as quoted in public reports in 2026 (gh-get, Traigent). The message names an OAuth app, so the steps for an app apply: open single sign-on settings, click Sign in next to the organization, and sign in to the GitHub CLI again (authorizing an app for single sign-on). - A public repository, and how long it lasts: GitHub's documentation says no IdP sign-in is needed to view a public repository's overview page and files, to fork it, or to read it with Git, such as cloning, but one is needed for other access, such as viewing its issues, pull requests, projects and releases. The sign-in lasts 24 hours unless the IdP sets otherwise, then you sign in through the IdP again (about authentication with SSO).
- An internal repository: access to SSO protected
internalresources in an enterprise, such as repositories, projects and packages, requires an SSO session for any organization in the enterprise, so code and work can be shared across organizations without joining each one (about authentication with SSO).
Fine-grained tokens
GitHub: fine-grained personal access tokens are authorized during token creation, before access to the organization is granted. The steps above are for classic tokens. A fine-grained token reaches an organization's resources only with that organization as its Resource owner; if it still cannot, see "Resource not accessible by personal access token".
In IntelliJ IDEA: "User authorization failed"
Checked in the IntelliJ IDEA source on October 30, 2026: GithubApiRequestExecutor.kt, GithubApiRequest.kt, GHAPIExceptionUtil.kt, GHSelectorErrorStatusPresenter.kt.
When the Pull Requests tool window connects and GitHub refuses with this 403, the IDE reads:
Could not connect to repository … with account …
User authorization failed
Log in again…
A REST 403 whose message does not say "API rate limit exceeded" is taken as a refused login, this one included, and GitHub's message is not shown.
The request code does not read X-GitHub-SSO, so the URL to authorize the token is not offered. Authorize it as above, or take the URL from the curl above. Log in again… does not authorize the token; that happens on GitHub.
The token login's Generate… opens the form for a classic token (what it fills in), and a classic token made there needs Configure SSO as above before it reaches the organization.
GitHub pull requests in IntelliJ IDEA
Pull Request Inbox for GitHub, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, works with a fine-grained token or a classic one with repo. When GitHub answers 403 with the X-GitHub-SSO header, the plugin says that the organization signs in with SAML single sign-on and shows the authorization address from the header; authorize the token there, then refresh. The review inbox, diffs and conversations are free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GitHub is a trademark of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitHub, Inc. or JetBrains.
More: "Resource not accessible by personal access token" · "API rate limit exceeded" · GitHub merge refused (405, 409) · GitHub review refused (422) · GitHub search 422 "Validation Failed" · GitHub diff 406 "too_large", 3,000 files · GitHub line comment 422 "must be part of the diff" · GitHub branch update refused (422) · GitHub pull request not created (422, 403) · GitHub auto-merge refused · GitHub draft, ready for review or close refused · GitHub conversation not resolved · GitHub checks not shown (check runs 403) · GitHub file contents not read · GitHub compare refused (404, 422) · GitHub comment or reply refused (403 locked, archived) · GitHub merge method not allowed (405) · GitHub branch not found (404, 301) · GitHub Enterprise Server not reached · GitHub review request not shown · GitHub pull request list incomplete · GitHub 404 Not Found, renamed repositories (301, 307) · GitHub line comment outdated or not on the diff · GitHub pull requests not updating, notifications late · GitHub suggested change cannot be applied · GitHub required check stuck at "Expected" · GitHub code owner review required · GitHub merge blocked by unresolved conversations · GitHub merge blocked by unsigned commits · GitHub branch that merges through a merge queue · GitHub merge waiting for an approval of the most recent push · GitHub merge waiting for code scanning results · GitHub merge waiting for code quality results · GitHub merge blocked by a code coverage threshold · GitHub merge blocked by license compliance results · GitHub branch locked or its updates restricted · GitHub branch not deleted after merging · GitHub merge waiting for a team's approval (Required reviewers) · GitHub merge blocked by secret scanning alerts · GitHub stacked pull request not merging · GitHub push blocked by push rules · GitHub merge blocked by commit metadata rules · GitHub force push blocked · GitHub issue not closed by a merged pull request · GitHub pull request not checked out locally · GitHub pull request has merge conflicts · GitHub changes requested and dismissing a review · GitHub co-author not credited for a commit · GitHub dependency review check failed · GitHub Dependabot not rebasing its pull request · GitHub fork not syncing with upstream · GitHub pull request base branch not changing · GitHub pull request not reverting · GitHub pull request template not showing · GitHub pull request labels or assignees not added · GitHub pull request not closing or reopening · GitHub push blocked by push protection · GitHub pull request comment hidden · GitHub pull request blocked until deployments succeed · GitHub team review request replaced by members · GitHub pull request file no longer marked Viewed · GitHub pull request marked merged without being merged · GitHub Copilot review does not count as an approval · GitHub checks not running on a pull request a workflow created · GitHub Update branch button not shown on a pull request · GitHub checks failing on a Dependabot pull request · GitHub checks failing on a pull request from a fork · GitHub checks skipped by [skip ci] in a commit message · GitHub checks gone after the retention period · GitHub code review limits in a public repository · GitHub pull requests turned off or limited in a repository · GitHub checks run on every pull request in a stack · GitHub pull request showing commits already squash merged · GitHub pull request not showing a file diff · GitHub push to a pull request branch from a fork refused · GitHub check cancelled on a pull request · GitHub Rebase and merge not available · GitHub merge commit message not what you expected · GitHub pull request shows every line changed · GitHub API request timed out · GitHub pull request image or document diff not shown · GitHub review request refused (422) · GitHub pull request from Copilot: checks not running, approval not counted · GitHub push refused: GH006 and GH013 on a protected branch · GitHub "At least 1 approving review is required", approvals that do not count · GitHub pull request plugins for IntelliJ IDEA, compared · 日本語