1 00:00:00,210 --> 00:00:02,430 Hello and welcome to this video. 2 00:00:02,460 --> 00:00:07,760 In this video, I'll be showing you how to create a personal access token. 3 00:00:07,770 --> 00:00:10,080 What is a personal access token? 4 00:00:10,230 --> 00:00:19,440 Personal access tokens are basically an alternative to using passwords for authentication to GitHub. 5 00:00:19,440 --> 00:00:28,050 When you are using GitHub APIs or when you are referencing GitHub from the command line, GitHub advises 6 00:00:28,050 --> 00:00:34,710 that you set an expiry date when you create your personal access tokens. 7 00:00:34,770 --> 00:00:43,440 Also, as a security precaution, GitHub automatically removes personal access tokens that have not 8 00:00:43,440 --> 00:00:48,310 been used in a year to create a personal access token. 9 00:00:48,390 --> 00:00:54,660 Make sure that you have signed into your GitHub account and then where you have your profile, there 10 00:00:54,660 --> 00:00:59,070 is a dropdown click on the dropdown and select settings. 11 00:00:59,070 --> 00:01:00,240 On the left side. 12 00:01:00,240 --> 00:01:04,620 Scroll down on you see the option for developer settings. 13 00:01:04,650 --> 00:01:07,200 Click on that on the left hand side. 14 00:01:07,200 --> 00:01:14,070 Click on Personal Access Tokens on the right, click on the button that says Generate new token. 15 00:01:14,100 --> 00:01:19,230 You can give the token a descriptive name, for example. 16 00:01:19,470 --> 00:01:22,380 What is the token good to be used for? 17 00:01:22,530 --> 00:01:24,370 You can add that description here. 18 00:01:24,390 --> 00:01:31,300 Once you've added a note, you have to set an expiry date for the token. 19 00:01:31,320 --> 00:01:35,730 So the default there is 30, so you can click on the dropdown. 20 00:01:35,760 --> 00:01:43,950 You can extend that or set a custom, but it is not recommended that you have no expiry date. 21 00:01:44,040 --> 00:01:47,380 So I'm going to give my 90 days for now. 22 00:01:47,400 --> 00:01:52,030 Next, you have to select a scope for your token. 23 00:01:52,050 --> 00:01:58,590 So basically what you're doing, your selecting the scopes or the permissions that you would like to 24 00:01:58,590 --> 00:02:00,720 grant the token to have. 25 00:02:00,840 --> 00:02:08,010 So to use your token in order to access repository, for example, from the command line, you need 26 00:02:08,010 --> 00:02:11,310 to select the option that says Ripple. 27 00:02:11,670 --> 00:02:19,200 So that will enable you to access your repositories from the command line so that the scopes I need. 28 00:02:19,440 --> 00:02:20,850 I've got triple checked. 29 00:02:21,090 --> 00:02:28,530 I've also got admin checked here, and I've also got the ability to delete a repo check. 30 00:02:28,620 --> 00:02:34,350 So you just need to select the relevant scopes you want your token to work in. 31 00:02:34,440 --> 00:02:40,590 So these will give your token access to these various groups that have been selected. 32 00:02:40,620 --> 00:02:44,310 So once you've done that, click on the Generate token button. 33 00:02:44,430 --> 00:02:52,410 It's very important that you treat your token like a password and keep them secret and safe when working 34 00:02:52,410 --> 00:02:57,340 with the API or when using the token in the command line. 35 00:02:57,390 --> 00:03:00,960 Make sure that they are not exposed. 36 00:03:01,080 --> 00:03:08,460 You can always generate new tokens using the Generate New Token tab, or you can revoke all the tokens 37 00:03:08,460 --> 00:03:11,310 you have using the Revoke All option. 38 00:03:11,400 --> 00:03:15,900 You can also delete your token using the Delete option.