Personal Access Tokens (PAT)

Introduction to GitHub Concepts

George Boorman

Curriculum Manager, DataCamp

Authentication

  • Can use Git in the terminal to interact with GitHub
git clone https://github.com/george-boorman/bank_marketing
Username for 'https://github.com': george-boorman
Password for 'https://[email protected]':
Introduction to GitHub Concepts

Authentication failed

 

 

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-
repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/george-boorman/bank_marketing/'
Introduction to GitHub Concepts

GitHub Docs

GitHub Docs page with instructions to provide a personal access token (PAT) when performing git clone, fetch, pull, or push to a remote repository.

1 https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls
Introduction to GitHub Concepts

What is a Personal Access Token?

  • Personal Access Token (PAT)

    • An alternative to using passwords for authentication in the terminal
    • Required since August 2021 instead of passwords
    • More secure
  • Not needed in GitHub

    • Only to access a remote repo using the terminal
1 https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
Introduction to GitHub Concepts

Creating a PAT

settings section access from the profile page

Introduction to GitHub Concepts

Creating a PAT

Developer settings in our settings page

Introduction to GitHub Concepts

Creating a PAT

Developer settings page with three options: GitHub Apps, OAuth Apps, and Personal access tokens

Introduction to GitHub Concepts

Creating a PAT

Personal access tokens section, with a button to Generate new token

Introduction to GitHub Concepts

Creating a PAT

Note and Expiration sections of the new PAT

Introduction to GitHub Concepts

Creating a PAT

Selecting the repo access checkbox

Introduction to GitHub Concepts

Creating a PAT

Generate token button

Introduction to GitHub Concepts

Using the PAT

PAT on display as a mixture of letters and numbers, which we can copy

Introduction to GitHub Concepts

Using the PAT

PAT highlighted as a mixture of letters and numbers, which we can copy

  • Don't share a PAT!
Introduction to GitHub Concepts

Using the PAT

git clone https://github.com/george-boorman/bank_marketing
Cloning into 'bank_marketing'...
Username for 'https://github.com': george-boorman
Password for 'https://[email protected]':
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
ls
bank_marketing
Introduction to GitHub Concepts

Let's practice!

Introduction to GitHub Concepts

Preparing Video For Download...