Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement Github Authentication and Authorization in a CLI App

I am creating a new CLI project where I want to use the Github API to create new repo's. When googling, I found out that Github has deprecated Authorization API in favour of Web Authorization flow. I can see that maybe we should use a local redirect URL in the CLI app but I don't understand how to get started with this. Basically I need to authorize users (preferably with the Web Flow) use their API from my CLI.

Any help is appreciated. Thanks.

like image 680
Sriram R Avatar asked Dec 08 '19 11:12

Sriram R


People also ask

How do I authorize an app on GitHub?

You can select user-level permissions from within your GitHub App's settings in the User permissions section of the Permissions & webhooks page. For more information on selecting permissions, see "Editing a GitHub App's permissions."


1 Answers

You need to use authorization code flow with a Proof Key for Code Exchange. There is a really good article that I found here

like image 76
Yogeshwar Singh Avatar answered Oct 01 '22 15:10

Yogeshwar Singh