|
1 | | ---- |
2 | | -title: Managing your personal access tokens |
3 | | -shortTitle: 'Manage {% data variables.product.pat_generic %}s' |
4 | | -intro: 'You can use a {% data variables.product.pat_generic %} in place of a password when authenticating to {% data variables.product.prodname_dotcom %} in the command line or with the API.' |
5 | | -redirect_from: |
6 | | - - /articles/creating-an-oauth-token-for-command-line-use |
7 | | - - /articles/creating-an-access-token-for-command-line-use |
8 | | - - /articles/creating-a-personal-access-token-for-the-command-line |
9 | | - - /github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line |
10 | | - - /github/authenticating-to-github/creating-a-personal-access-token |
11 | | - - /github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token |
12 | | - - /github/extending-github/git-automation-with-oauth-tokens |
13 | | - - /authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token |
14 | | -versions: |
15 | | - fpt: '*' |
16 | | - ghes: '*' |
17 | | - ghec: '*' |
18 | | -topics: |
19 | | - - Identity |
20 | | - - Access management |
21 | | ---- |
22 | 1 |
|
23 | | -> [!WARNING] |
24 | | -> Treat your access tokens like passwords. For more information, see [Keeping your {% data variables.product.pat_generic %}s secure](#keeping-your-personal-access-tokens-secure). |
25 | | -
|
26 | | -## About {% data variables.product.pat_generic %}s |
27 | | - |
28 | | -{% data variables.product.pat_generic_caps %}s are an alternative to using passwords for authentication to {% data variables.product.github %} when using the [{% data variables.product.github %} API](/rest/overview/authenticating-to-the-rest-api) or the [command line](#using-a-personal-access-token-on-the-command-line). |
29 | | - |
30 | | -{% data variables.product.pat_generic_caps %}s are intended to access {% data variables.product.company_short %} resources on behalf of yourself. To access resources on behalf of an organization, or for long-lived integrations, you should use a {% data variables.product.prodname_github_app %}. For more information, see [AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/about-creating-github-apps). |
31 | | - |
32 | | -{% data reusables.user-settings.token_access_capabilities %} For example, a {% data variables.product.pat_generic %} can be configured with an `admin:org` scope, but if the owner of the token is not an organization owner, the token will not give administrative access to the organization. |
33 | | - |
34 | | -### Types of {% data variables.product.pat_generic %}s |
35 | | - |
36 | | -{% data variables.product.company_short %} currently supports two types of {% data variables.product.pat_generic %}s: {% data variables.product.pat_v2 %}s and {% data variables.product.pat_v1_plural %}. {% data variables.product.company_short %} recommends that you use {% data variables.product.pat_v2 %}s instead of {% data variables.product.pat_v1_plural %} whenever possible. |
37 | | - |
38 | | -> [!NOTE] |
39 | | -> {% data variables.product.pat_v2_caps %}s, while more secure and controllable, cannot accomplish every task that a {% data variables.product.pat_v1 %} can. See the section on [{% data variables.product.pat_v2_caps_plural %} limitations](#fine-grained-personal-access-tokens-limitations) below to learn more. |
| 2 | +https://github.com/settings/personal-access-tokens/new |
| 3 | + ?name=Repo-reading+token |
| 4 | + &description=Just+contents:read |
| 5 | + &target_name=octodemo |
| 6 | + &expires_in=45 |
| 7 | + &contents=read |
40 | 8 |
|
41 | 9 | Both {% data variables.product.pat_v2 %}s and {% data variables.product.pat_v1_plural %} are tied to the user who generated them and will become inactive if the user loses access to the resource. |
42 | 10 |
|
|
0 commit comments