Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate personal access token in github using api

Tags:

github-api

Is there any way I can login to my github account via my username and password and generate personal access token using api ?

like image 828
Rio Avatar asked Mar 14 '26 01:03

Rio


1 Answers

UPDATE: per this blog post, they've deprecated the OAuth Authorizations API, that support generating personal access tokens.

so now, you'll have to generate it using the web settings page instead.

Original answer:

Calls to OAuth Authorizations API

If you're making OAuth Authorization API calls to manage your OAuth app's authorizations or to create personal access or OAuth tokens like:

curl -u my_username:my_password -X POST "https://api.github.com/authorizations" -d '{"scopes":["public_repo"], "note":"my token", "client_id":"my_client_id", "client_secret":"my_client_secret"}'

Then you must switch to the web application flow to generate access tokens.

like image 73
Victor Bouhnik Avatar answered Mar 16 '26 13:03

Victor Bouhnik