> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Configure Personal Access Tokens

> Explains GitHub personal access tokens comparing classic and fine-grained types, organization approval workflows, management interfaces, and best practices for issuing, monitoring, and securing tokens.

In this lesson we’ll explore GitHub Personal Access Tokens (PATs), comparing classic tokens and fine-grained tokens, showing how organization approval workflows affect token issuance, and where to view active and pending tokens in organization settings. This walkthrough uses the Game Dev Studio organization to demonstrate organization-level controls for PAT creation and management.

Where to find Personal Access Token settings

* User-level: Account → Developer settings → Personal access tokens.
* Organization-level: Organization → Settings → Security (or Third-party access) → Personal access tokens (where you’ll find Settings, Active tokens, and Pending requests).

Classic personal access tokens

Classic tokens use scope-based (coarse) permissions that apply to all repositories your user account can access. You cannot restrict a classic token to a single repository from the token creation flow — selected scopes are global to your user’s repository access.

How to create a classic token

1. Go to Developer settings → Personal access tokens → Tokens (classic).
2. Click “Generate new token (classic)”.
3. Provide a note (name), set an expiration, and select scopes (for example, `repo`).
4. Generate the token and copy it immediately — classic tokens are issued immediately and do not require organization admin approval.

![A screenshot of GitHub's Developer Settings showing the "New personal access token (classic)" form with the note set to "test-token", expiration set to 30 days, and repo-related scopes checked. The left sidebar highlights "Personal access tokens" → "Tokens (classic)".](https://mintcdn.com/kodekloud-c4ac6d9a/TlnHw4JjIHBx3Cta/images/GitHub-Administration-Certification/Security-and-Compliance/Demo-Configure-Personal-Access-Tokens/github-pat-classic-test-token-30d.jpg?fit=max\&auto=format\&n=TlnHw4JjIHBx3Cta\&q=85\&s=5c8657f0634e9b6696d909c1de38df3e)

Key characteristics of classic tokens

| Characteristic | Details |
| - | - |
| Permission model | Scope-based permissions (coarse) |
| Repository limitation | Cannot be limited to a specific repository during creation |
| Approval required | No organization admin approval required |
| Issuance | Issued immediately when created |

Fine-grained personal access tokens

Fine-grained tokens give you much more control. They allow repository-level selection as well as per-feature permission levels (for example, read vs. read & write for Actions, Codespaces, Issues, and so on). Fine-grained tokens are ideal when you need least-privilege credentials limited to specific repositories and operations.

When creating a fine-grained token you can:

* Select the resource owner (your user account or a specific organization).
* Choose repository scope: all repositories, public-only, or selected repositories.
* Configure granular permissions per repository feature (e.g., Actions read, Codespaces write).
* Set a token expiration.

Example creation flow (organization-owned token)

1. Choose “Generate new token” → select “for an organization” as the resource owner.
2. Choose repositories (e.g., only selected repositories).
3. Set granular permissions and an expiration.
4. If the organization requires approvals, click “Generate token and request access” — this creates a pending request and the token cannot be used until approved.

![A dark-mode screenshot of GitHub's "New Personal Access Token" settings showing "Only select repositories" with game-devstudio/ghas-guardrail-demo selected. The Permissions panel lists Actions, Codespaces, and Metadata access levels and a green "Generate token and request access" button at the bottom.](https://mintcdn.com/kodekloud-c4ac6d9a/TlnHw4JjIHBx3Cta/images/GitHub-Administration-Certification/Security-and-Compliance/Demo-Configure-Personal-Access-Tokens/github-pat-select-repos-ghas-demo.jpg?fit=max\&auto=format\&n=TlnHw4JjIHBx3Cta\&q=85\&s=cf58304ff007d79a29ccec072a6651cf)

Pending tokens and admin approval

If an organization requires administrator approval for fine-grained tokens, newly generated tokens show up in a pending state and are unusable until an owner or admin approves them. Pending requests include the requester, requested permissions, selected repositories, and any request reason provided.

Example token string (UI example — treat as secret if real):

```text theme={null}
github_pat_11CM3IQKQ8QnjfZFWJhi3U_zcgDVrjZNfwfS8EXLprt5HPoDtT3Fk2xu0ZxqzS9BCMOMYBNP4mc3E
```

Organization admins can review and act on requests from Organization settings → Personal access tokens → Pending requests.

![A screenshot of a GitHub organization settings page showing a fine‑grained personal access token request with a short request reason. The page lists requested repository permissions (e.g., read access to actions and write access to codespaces) and shows Approve and Deny buttons.](https://mintcdn.com/kodekloud-c4ac6d9a/TlnHw4JjIHBx3Cta/images/GitHub-Administration-Certification/Security-and-Compliance/Demo-Configure-Personal-Access-Tokens/github-org-fine-grained-pat-request.jpg?fit=max\&auto=format\&n=TlnHw4JjIHBx3Cta\&q=85\&s=656fa68e266b5613db1cd6b76bdc25ef)

Organization settings for fine-grained tokens

Organization owners and admins control enforcement settings for fine-grained tokens. Key organization-level controls include:

* Require administrator approval for fine-grained tokens.
* Configure a maximum token lifetime (enforce token expiration limits).

These controls help enforce least privilege and lifecycle policies across organization-owned tokens.

![Dark-mode screenshot of a GitHub organization's "Personal access tokens" settings page. It shows options to require administrator approval for fine-grained tokens and to set a maximum token lifetime (366 days), with the left navigation menu visible.](https://mintcdn.com/kodekloud-c4ac6d9a/TlnHw4JjIHBx3Cta/images/GitHub-Administration-Certification/Security-and-Compliance/Demo-Configure-Personal-Access-Tokens/github-org-personal-access-tokens-settings.jpg?fit=max\&auto=format\&n=TlnHw4JjIHBx3Cta\&q=85\&s=ad3f7e045f45db666360b1c0e6431c85)

Viewing active tokens and usage

Organization admins can inspect active personal access tokens and their usage. The Active tokens view typically shows token name, owner, last used timestamp, and the repositories or permissions associated with the token. Use this view to identify stale or over-privileged tokens for rotation or revocation.

![A dark-mode screenshot of a GitHub organization settings page for "game-devstudio" showing the "Fine‑grained personal access tokens" area with one token named "fine-grained-token-test" owned by "sid-dev2-kk." The left sidebar lists various organization settings like Billing and plans, Organization roles, Repository roles, Codespaces, and Actions.](https://mintcdn.com/kodekloud-c4ac6d9a/TlnHw4JjIHBx3Cta/images/GitHub-Administration-Certification/Security-and-Compliance/Demo-Configure-Personal-Access-Tokens/github-game-devstudio-finegrained-pat-screenshot.jpg?fit=max\&auto=format\&n=TlnHw4JjIHBx3Cta\&q=85\&s=cc2f434233199e8b27aa95aa446a2d0f)

Comparing classic and fine-grained tokens

| Aspect | Classic personal access tokens | Fine-grained personal access tokens |
| - | -: | - |
| Scope granularity | Coarse (scopes apply across all repos) | Fine-grained (per-repo, per-feature permissions) |
| Repository restriction | No | Yes (select specific repos) |
| Organization approval | Not required | Optional (can require admin approval) |
| Recommended use | Personal automation where org control is not needed | Organization access, least-privilege scenarios |

Best practices and security notes

Prefer fine-grained tokens for organization access to restrict permissions to only the necessary repositories and actions. Enforce approval workflows and maximum token lifetimes at the organization level to reduce risk.

Treat all PATs as secrets. Do not commit tokens to source control, public gists, or logs. Rotate tokens regularly, set short but practical expirations, and revoke lost or unused tokens immediately.

Links and references

* GitHub Docs: Personal access tokens — [https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
* GitHub Docs: Fine-grained personal access tokens — [https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#fine-grained-personal-access-tokens](https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#fine-grained-personal-access-tokens)
* GitHub Docs: Organization settings for personal access tokens — [https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-personal-access-tokens-in-your-organization](https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-personal-access-tokens-in-your-organization)

If you want, I can add step-by-step screenshots annotated with the exact clicks for your org or create a checklist for token lifecycle management (creation, approval, usage review, rotation, and revocation).

> [card] [Watch Video](https://learn.kodekloud.com/user/courses/github-administration-certification/module/d477d0b2-5ca0-43b2-aed7-7d82887400f7/lesson/317d22b4-b3ca-4099-9c81-a2d1c4833aa1)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.