Connect github using OAuth in javascript

Is it possible to connect to Github using oAuth in JAVASCRIPT / AJAX / JQuery

I came across its implementation in php and node.js, but I need to have it in js. Is it possible. Any links?

According to http://developer.github.com/v3/oauth/ , I cannot implement it in js.

Here is a link to implement in php, please help me implement the same in js / ajax / jquery.

thanks

+6
source share
2 answers

No, for security reasons, you cannot login with client code only. This is the protection of the client’s secret code.

You can create a simple server application that protects your codes. For example, see https://github.com/prose/gatekeeper

+1
source

I was just looking for the same problem and apparently this is not possible. what you requested is called Implicit Submission, and the link you provided for the Github api states that:

Implicit grant type not supported

You can access it using cors or jsonp, which are referred to as methods for using the Github api ( json-p , cors ), but if you are not authenticated, the speed limit is limited to 60 requests per hour <a4>

Edit:

So, I did some reading, if you want to use their api with a web browser script, you can create a Personal access token and define it as no scope . This will only provide access to your publicly available information. Thus, you can use this token without fear of publicly publishing it on a website, and someone is abusing it.

0
source

Source: https://habr.com/ru/post/948368/


All Articles