Giter Site home page Giter Site logo

Comments (6)

hzoo avatar hzoo commented on June 15, 2024

Interesting.. although it's weird in chrome app samples that they just put the client id/secret right there https://github.com/GoogleChrome/chrome-app-samples/blob/master/samples/github-auth/index.js#L9-L14 (how would you do so otherwise without a backend?)

from contributors-on-github.

sindresorhus avatar sindresorhus commented on June 15, 2024

// @imjasonh

from contributors-on-github.

hzoo avatar hzoo commented on June 15, 2024

Ah and this is because it only gives you a code and you need a separate xhr to get the actual token: https://github.com/GoogleChrome/chrome-app-samples/blob/e347c538e8612aa3b0f90bde0fc721c4f0569125/samples/github-auth/index.js#L69-L77

GitHub's OAuth implementation supports the standard authorization code grant type. Developers should implement the web application flow described below to obtain an authorization code and then exchange it for a token. (The implicit grant type is not supported.)

from contributors-on-github.

imjasonh avatar imjasonh commented on June 15, 2024

The client ID and secret are also only usable with your specified callback URL, like https://YOUR_EXTENSION_ID.chromiumapp.org, which then redirects to your extension.

Attempting to use a different callback URL will fail before requesting the user's permission.

from contributors-on-github.

hzoo avatar hzoo commented on June 15, 2024

Hmm alright so I guess this is just how you do it for a chrome extension then? Will try to get this in then, since getting an access token can be annoying

from contributors-on-github.

hzoo avatar hzoo commented on June 15, 2024

Done with #9!

from contributors-on-github.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.