-2
import requests

from requests.auth import HTTPBasicAuth

a=requests.get('https://api.github.com/user',auth=HTTPBasicAuth('email','pass'))
print(a.status_code)

I am entering right GitHub email and password but getting error 401

Aurélien
  • 1,617
  • 1
  • 21
  • 33
  • 1
    Does this answer your question? [401 Unauthorized access for Github API using HttpBuilder (Groovy)](https://stackoverflow.com/questions/17646734/401-unauthorized-access-for-github-api-using-httpbuilder-groovy) – ewokx May 03 '22 at 08:05

1 Answers1

0

Username: password is not longer supported by GitHub for API https://docs.github.com/en/rest/overview/other-authentication-methods#via-oauth-and-personal-access-tokens

gnight
  • 429
  • 2
  • 10