Skip to main content
This article shows how to authorize a GitHub Personal Access Token (PAT) for an organization that enforces SAML Single Sign-On (SSO). If a PAT has not been authorized by the organization’s SAML SSO, API requests to organization-protected resources will fail with a 403 error. Example error returned by the API:
Overview: authorize the token via your GitHub account settings, complete the identity provider (IdP) SSO flow, then retry the API request using the same PAT.

Step-by-step: Authorize the PAT for SAML SSO

  1. Open GitHub and sign in with the account that owns the PAT.
  2. Go to Settings → Developer settings → Personal access tokens.
  3. Find the PAT you want to use and click Configure SSO.
  4. Follow the SSO flow: sign in to your Identity Provider and complete any multi-factor authentication (MFA) required.
When prompted, you may need to enter a code from your MFA app (for example, Okta Verify).
A browser window showing an Okta two-factor authentication prompt. The page asks the user to enter a code from the Okta Verify app with a text field and a "Verify" button.
After you complete the IdP sign-in and MFA steps, GitHub will confirm the credential (and therefore the PAT) is authorized to access the organization.
A dark-themed GitHub webpage screenshot with a centered modal saying a credential has been authorized to access the "game-devstudio" organization and a green "Continue" button. Browser tabs and a small banner about a 26-day trial are visible along the top.
By authorizing a PAT for an organization, organization owners can view the token’s access scopes and the last-used timestamp. Deauthorize tokens when they are no longer needed.
Never share your PAT. If a token is compromised or no longer required, revoke it immediately and rotate any automation that used it.

Retry the API request

Once the PAT is authorized, retry the same API call (using Postman, curl, or your preferred HTTP client). Example request header using the PAT:
Successful response (truncated):
In this repository you should see workflows such as “Using Reusable CI Workflow” and “Using Composite Workflow” returned by the API. This confirms the PAT can access organization-protected resources after SAML SSO authorization.

Quick reference

Troubleshooting

  • Still seeing a 403 after authorization?
    • Verify the PAT has the required scopes (for repository access, include repo).
    • Ensure you’re authorizing the correct token and GitHub account.
    • If your organization recently changed SSO settings, sign out and sign back in, then retry the Configure SSO flow.
  • For automation: if a PAT is used by CI/CD, check whether the CI environment needs a fresh token or a reauthorization step.

Watch Video