How to Create GitHub PAT Token

So, what is GitHub Personal Access Token (PAT) and how to create one. If you are looking for a way to secure your GitHub authentication to other services online, you can use GitHub Personal Access Token instead of your GitHub Username and Password. For instance, if you find a service online which requires the login authentication using either Google, Facebook, or GitHub. And you decide to go with GitHub, so instead of inserting your username and password, you will enter a more secure Personal Access Token and that’s all. It will sign you up.  

Why use GitHub Personal Access Token?

For one thing, GitHub has deprecated the use of username and password to get but authentication to other services. That doesn’t mean you can’t use it, but it is encouraged not to. The other reason for using PAT is because it’s rather more secure version of authenticating for your GitHub account to other online services and API access. Another reason would be, that this is what’s being used out there in the market right now. And if you’ve followed my other blogs, you might know that I like to follow what’s latest out there. And PAT is not only the latest thing, it’s also free and more secure? Sign me up! 

Check out the GitHub Documentation for further information. 

How to use GitHub Personal Access Token?

So, GitHub PAT is exactly like a password, therefore you need to keep it safe and securely noted down at a place. PAT is a token, and so it’s very long to just memorize like any other password. That’s why you need to note it down at the place. Then whenever you must authenticate to GitHub on any web service, instead of using your get your password you will be using GitHub PAT. And that’s all there is to it. 

What’s the difference between SSH and PAT?

Well, this is a really good question. To understand what SSH is, its features and how it’s used, check out my article right here. But in a nutshell, SSH is used for remote access to a server and has its access to securely transfer or retrieve any data. Whereas PAT is used to securely authenticate to GitHub when signing up for any web service, as a replacement for traditional passwords.

So, without wasting any more words, let’s see how we can create GitHub Personal Access Token. (P.S. it’ll take hardly 4 minutes to make one) 

STEP 1

Open your GitHub account and click on the profile picture on the top right. It will show you a dropdown, where you will select the settings option. As shown below: 

SSH to Link with GitHub - Settings Option to Add Keys
GitHub Personal Access Token - GitHub settings option to create PAT

STEP 2

On the left panel that will show up, select “Developer Setting” like so:  

GitHub PAT Developers Option
GitHub PAT Developers Option

STEP 3

Click on “Personal access tokens”  first and then click on “Generate new token” as shown below: 

Generating new PAT Token
Generating new PAT Token

STEP 4

It’s going to ask you for your GitHub password, just enter that. Then it will take you to a simple form to assign rights to the token that you want to generate. 

Configuring PAT Token
Configuring PAT Token

STEP 5

Lastly, just give the relevant rights that you want this token to have and then hit “Generate token” button. Like so: 

Providing Rights to the Token
Providing Rights to the Token

SUCCESS! 

This shows that your Public Access Token has been created. Now this is important. COPY THIS TOKEN shown in the below picture. It is showing you this one time only, and it won’t again. So, make sure that you copy and save it at a secure location. Otherwise, you’ll have to create a new PAT. 

Successfully Generated GitHub PAT
Successfully Generated GitHub PAT

And that’s it! 

Your GitHub Public Access Token is now generated. Now you can use this whenever you signup/login on a website using GitHub account. This token would be entered instead of the password.  

Hope this was helpful. If it was, then please leave a comment down below and share it with others. Thanks, and have a great one!