Skip to content

Provide instructions for GitHub's new "fine-grained" personal access tokens #6092

Closed as not planned

Description

@aheckler

Description

GitHub recently introduced a new personal access token generator, detailed in this blog post:

https://github.blog/2022-10-18-introducing-fine-grained-personal-access-tokens-for-github/

The page where you can generate a token:

https://github.com/settings/tokens?type=beta

Refined GitHub might want to provide instructions for using this method to generate a token.

Screenshot

Screenshot taken on 2022-10-20 at 13 40 39 UTC@2x

Old token generation page is now labelled "Classic".

Example URLs

The extension settings page perhaps, or maybe somewhere in this repo?

Activity

  1. busches commented on Oct 20, 2022

    @busches
    Member

    It's still in beta and we deep link to the existing page already. Good to keep an eye on, but probably not something we want to make any changes for now.

  2. fregante commented on Oct 20, 2022

    @fregante
    Member

    I was going to open a new issue about it yesterday but I wasn't sure if we need to make any changes at all. For Refined GitHub to work, we need write access to all repos, which seems to still be available.

    I don't particularly want to spend time requesting exclusively the permissions we're currently using and then having to deal with broken new features later. If the user decides to customize the page, they'd do at their own peril/safety.

    We will likely still need to update the options UI though to ensure we correctly represent partial permissions, if any.

  3. fregante commented on Oct 21, 2022

    @fregante
    Member

    Never mind, they actually broke existing tokens too, probably by mistake. This is what I see after clicking Update PR

    Screen Shot 1

  4. mtsknn commented on May 10, 2023

    @mtsknn

    I was going to generate a new beta token (i.e. a fine-grained token) because my classic token doesn't work anymore in a private organization. Refined GitHub logs this to the console:

    ℹ️ ci-link → GraphQL:
    redacted_organization_name forbids access via a personal access token (classic). Please use a GitHub App, OAuth App, or a personal access token with fine-grained permissions.

    I don't know what permissions I should choose when generating a beta token, so documentation would be nice.

    I anyway tried generating a beta token, but Refined GitHub's options page seems to accept only classic tokens (ghp_...), not beta tokens (github_pat_...):

    <input type="text" name="personalToken" pattern="[\da-f]{40}|ghp_\w{36,251}" placeholder=" " spellcheck="false" autocomplete="off" autocapitalize="off">

    const tokenField = select('input[name="personalToken"]')!;
    if (!tokenField.validity.valid || tokenField.value.length === 0) {
    expandTokenSection();
    return;
    }

  5. fregante commented on May 10, 2023

    @fregante
    Member

    Thanks for the detailed report, @mtsknn!

    Support for fine-grained tokens should come in the next release.

    my classic token doesn't work anymore in a private organization.

    That can be customize in the token itself, I've been using the same classic token for a while and it works even on private repos. See this screenshot taken on https://github.com/refined-github/private/issues/1 with a classic token and with bugs-tab working (which requires a token)

    Screenshot 7
  6. mtsknn commented on May 10, 2023

    @mtsknn

    Support for fine-grained tokens should come in the next release.

    Nice!


    I've been using the same classic token for a while and it works even on private repos.

    My classic token has also worked in private repos so far, but today I noticed that it doesn't work in a repo under a certain private organization. So I think it's an organization-level setting; the console logging quoted in my previous comment also says so (or so I interpret it):

    organization_foo forbids access via a personal access token (classic). [...]

    Organization settings > Personal access tokens (e.g. https://github.com/organizations/refined-github/settings/personal-access-tokens-onboarding) looks like this in one of my own private organizations:

    image

    Step 3 is "Restrict access via personal access tokens (classic)" – I think my problem stems from this, but I can't check the settings of the problematic organization because I'm not authorized to do that.

    (Whoops, a bit off topic maybe.)


    Edit: whoops 2: I have been talking about "private organizations," but I don't know if they are even a thing.

  7. added
    meta
    and removed on Jun 1, 2023
  8. fregante commented on Jun 1, 2023

    @fregante
    Member

    Update: in most cases, you can continue using the classic tokens without issue. GitHub’s error message with workflow is actually super clear so we don't need to update anything at this point.

    This is now purely a documentation issue and I don't see the urgency to document it just yet (also because we'd also have to update the scope-checker widget, etc etc)

    Please open new bug reports if you find bugs. 🐛

  9. thealphadollar commented on Aug 18, 2023

    @thealphadollar

    This is now purely a documentation issue and I don't see the urgency to document it just yet (also because we'd also have to update the scope-checker widget, etc etc)

    Hey @fregante , I think it would be a nice to have update since a lot of organizations have disabled Classic PATs and the extension is unusable in those cases 😢

  10. amaisano commented on Sep 18, 2023

    @amaisano

    Is this why I am now unable to use the (X) button on labels on my PR? I receive this error:

    Unable to fetch. Ensure that your token has access to this repo. { "message": "m*** forbids access via a personal access token (classic). Please use a GitHub App, OAuth App, or a personal access token with fine-grained permissions.", "documentation_url": "https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue" }

  11. 134130 commented on Sep 18, 2023

    @134130
    Contributor

    @amaisano It seems. Your organization maybe forbids Classic token.

  12. fregante commented on Sep 23, 2023

    @fregante
    Member

    Fine-grained tokens are ultimately not compatible with Refined GitHub at the moment.

    • Classic tokens give access to the same repositories a user has access to, but fine-grained are scoped per-user/per-organization.

    • Supporting multiple tokens would requires a lot of code changes around the options page and API calls, it's not going to happen until GitHub sunsets classic tokens

    • You literally cannot create tokens for some organizations, for example I'm part of 8 organizations but can only create tokens for 2

      Screenshot 11
    • It looks like there's no URL shortcut to pre-fill the form, like there used to be

      Optional, <a id="personal-token-link" href="https://github.com/settings/tokens/new?description=Refined%20GitHub&scopes=repo,delete_repo,read:project">generate one</a><br>

    In short:

    • If your organization does not support classic tokens, then Refined GitHub can only read public data from those organizations
    • If you want to use a fine-grained token, feel free to do so, but we're not going to keep a documentation page with all the (ever-changing) scope needs required. If you want to limit access to Refined GitHub, you will have to go through each scope anyway. Feel free to leave a comment with your findings though.
    • Note that we don't have access to the token nor do we ever collect any data, so you're effectively only limiting your own machine.

    In the future:

    Please open new issues if you encounter specific bugs with fine-grained tokens

  13. deleted a comment from mdbhm502 on Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedmeta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions