You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ topics:
16
16
- Access management
17
17
shortTitle: Create a PAT
18
18
---
19
-
Personal access tokens (PATs) are an alternative to using passwords for authentication to {% data variables.product.product_name %} when using the [GitHub API](/rest/overview/other-authentication-methods#via-oauth-and-personal-access-tokens) or the [command line](#using-a-token-on-the-command-line).
19
+
Personal access tokens (PATs) are an alternative to using passwords for authentication to {% data variables.product.product_name %} when using the [GitHub API](/rest/overview/other-authentication-methods#via-oauth-and-personal-access-tokens) or the [command line](#using-a-token-on-the-command-line).
20
20
21
21
{% ifversion fpt %}If you want to use a PAT to access resources owned by an organization that uses SAML SSO, you must authorize the PAT. For more information, see "[About authentication with SAML single sign-on](/github/authenticating-to-github/about-authentication-with-saml-single-sign-on)" and "[Authorizing a personal access token for use with SAML single sign-on](/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on)."{% endif %}
22
22
@@ -31,16 +31,17 @@ Personal access tokens (PATs) are an alternative to using passwords for authenti
31
31
4. Click **Generate new token**.
32
32

8. Click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the token to your clipboard. For security reasons, after you navigate off the page, you will not be able to see the token again.
44
45
{% ifversion fpt %}
45
46

46
47
{% elsif ghes > 3.1 or ghae-next %}
@@ -50,7 +51,7 @@ Personal access tokens (PATs) are an alternative to using passwords for authenti
50
51
{% endif %}
51
52
{% warning %}
52
53
53
-
**Warning:** Treat your tokens like passwords and keep them secret. When working with the API, use tokens as environment variables instead of hardcoding them into your programs.
54
+
**Warning:** Treat your tokens like passwords and keep them secret. When working with the API, use tokens as environment variables instead of hardcoding them into your programs.
{% ifversion fpt or ghes > 3.1 or ghae-issue-4374 %}
167
+
API requests using an expiring personal access token will return that token's expiration date via the `GitHub-Authentication-Token-Expiration` header. You can use the header in your scripts to provide a warning message when the token is close to its expiration date.
168
+
{% endif %}
169
+
158
170
### Get your own user profile
159
171
160
172
When properly authenticated, you can take advantage of the permissions
As a security precaution, {% data variables.product.prodname_dotcom %} automatically removes personal access tokens that haven't been used in a year.
1
+
As a security precaution, {% data variables.product.company_short %} automatically removes personal access tokens that haven't been used in a year.{% ifversion fpt or ghes > 3.1 or ghae-issue-4374 %} To provide additional security, we highly recommend adding an expiration to your personal access tokens.{% endif %}
0 commit comments