Hello and welcome to this video.
In this video, I'll be showing you how to create a personal access token.
What is a personal access token?
Personal access tokens are basically an alternative to using passwords for authentication to GitHub.
When you are using GitHub APIs or when you are referencing GitHub from the command line, GitHub advises
that you set an expiry date when you create your personal access tokens.
Also, as a security precaution, GitHub automatically removes personal access tokens that have not
been used in a year to create a personal access token.
Make sure that you have signed into your GitHub account and then where you have your profile, there
is a dropdown click on the dropdown and select settings.
On the left side.
Scroll down on you see the option for developer settings.
Click on that on the left hand side.
Click on Personal Access Tokens on the right, click on the button that says Generate new token.
You can give the token a descriptive name, for example.
What is the token good to be used for?
You can add that description here.
Once you've added a note, you have to set an expiry date for the token.
So the default there is 30, so you can click on the dropdown.
You can extend that or set a custom, but it is not recommended that you have no expiry date.
So I'm going to give my 90 days for now.
Next, you have to select a scope for your token.
So basically what you're doing, your selecting the scopes or the permissions that you would like to
grant the token to have.
So to use your token in order to access repository, for example, from the command line, you need
to select the option that says Ripple.
So that will enable you to access your repositories from the command line so that the scopes I need.
I've got triple checked.
I've also got admin checked here, and I've also got the ability to delete a repo check.
So you just need to select the relevant scopes you want your token to work in.
So these will give your token access to these various groups that have been selected.
So once you've done that, click on the Generate token button.
It's very important that you treat your token like a password and keep them secret and safe when working
with the API or when using the token in the command line.
Make sure that they are not exposed.
You can always generate new tokens using the Generate New Token tab, or you can revoke all the tokens
you have using the Revoke All option.
You can also delete your token using the Delete option.