GitHub Personal Access Tokens (PAT)
Tags: github, git, security, codenewbie
Published: 2022-06-02 23:00:53

> "Support for password authentication was removed. Please use a personal access token".

During my earliest stage in the tech space as a budding developer, I had hitches with GitHub. I mean, every developer experiences this. I tried to run git operations. I got the error message that indicated that password authentication was removed and I would need to use a personal access token. Thanks to instructions provided by my technical mentor, I was able to navigate through this challenge.
This article seeks to guide you through this process if you are at this phase in your programming journey.

### What is GitHub Personal Access Token?
Personal Access Token is a long string of characters used to authenticate a user when accessing the GitHub server instead of password-based authentication. In other words, if you want to run git operations, you will be required to generate a Personal Access Token rather than use a password you create for yourself.

### Features of GitHub Personal Access Token

1. It is unique
2. It is a long string of character combinations
3. It is more secure than passwords
4. It is hard to read
5. You have to generate it
6. You can decide if it expires or not (It is not advisable to create PAT with no expiry date)
7. It is revocable
8. It allows you to control access to certain features

### How To Create A GitHub Personal Access Token
**Step 1: Click your profile on GitHub:**


![snapshot of GitHub Profile icon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8h59sgvhb5v7hfoyq09.jpeg)

**Step 2: Go to settings:**

![snapshot of GitHub settings option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4xyiestts6340qqwn2f.jpeg)

**Step 3: Scroll down and click "Developer settings" at the bottom left:**

![snapshot of GitHub Developer settings option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z943nj0rnxosvmnp938j.jpeg)

**Step 4: Click "Personal access tokens":**

![snapshot of GitHub personal access tokens option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmke76kmdx4j60tpcjwm.jpeg)

**Step 5: Click "Generate new token":**

![snapshot of GitHub generate new token icon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ev807i969vfo25lmvtj.jpeg)

**Step 6: Type in your password and confirm access:**

![snapshot of GitHub confirm access page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hxm5ni9nc87ksxxbmc9k.jpeg)

**Step 7: Insert a note:**
This could be the project name.

![snapshot of GitHub insert a note page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rnih2gklxz2pgnpygdwa.jpeg)

**Step 8: Select the number of days before it expires:**

![snapshot of GitHub select expiry date option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxautjelyzs7rvjr9sq8.jpeg)

**Step 9: Select scopes to grant and limit access to certain features:**

![snapshot of GitHub select scopes page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p39b9aw5hay1umz4s5yi.jpeg)

**Step 10: Click "Generate token":**

![snapshot of GitHub generate token icon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8fulbdzl6e90tk7iolb.jpeg)

**Step 11: Copy the token:**
Make sure you copy the token and keep it safe so you can use it. If you don't, you will have to generate a new one to perform git operations.

### References

- https://docs.github.com/en/enterprise-server@3.1/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

- https://ourtechroom.com/tech/why-personal-access-token-how-to-generate-it-in-github/

### Cover Image Credit

- https://portswigger.net/cms/images/cd/86/ee60a79b68b6-article-190612-github-body-text.jpg