prose / gatekeeper

Enables client-side applications to dance OAuth with GitHub.
MIT License
761 stars 183 forks source link

Please simplify OAuth steps #54

Closed bsde1245 closed 6 years ago

bsde1245 commented 6 years ago

Hi, I am a newbie here. Please simplify OAth steps 1, 2 and 3. Where to put that codes?

Thanks.

dereklieu commented 6 years ago

The OAuth flow as it relates to this repo is laid out here:

https://github.com/prose/gatekeeper#oauth-steps

You put your secret info in config.json. The steps are also laid out:

https://github.com/prose/gatekeeper#setup-your-gatekeeper

I understand that OAuth can be difficult to grok initially. However, Github has very good documentation on this subject.

If you have specific points about how we might simplify the docs in this repo, I'd be open to incorporating them.

bsde1245 commented 6 years ago

Hi, Thanks for responding @dereklieu . Sorry to say that I am complete newbiew here. I deployed the app to heroku and prose to github. Here is the link http://editor.justinechacko.in/ The problem is after authorisation browser redirects to prose.io not to my site. Steps I did were,

1)First Register oAuth app with both homepage Url and callback url as http://editor.justinechacko.in 2)With OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET I created new app in heroku 3)Did a git clone of prose gh- pages repo, changed values in oauth.json of client_id and gatekeeperurl and deployed it to gh-pages of my repo named editor, and chenged cname to editor.justinechacko.in

Can you please check where the problem is? Thank you.

dereklieu commented 6 years ago

@justinechacko hey, it looks like the link in the "login" button sends a client id that's the same as the one Prose uses. That's probably the issue.

https://github.com/login/oauth/authorize?client_id=c602a8bd54b1e774f864&scope=repo

Have you changed your settings in oauth.json? link

bsde1245 commented 6 years ago

I am already using my client_id there, see https://github.com/justinechacko/editor/blob/gh-pages/oauth.json

NB: Is this causing problem "I registered oAuth app with both homepage Url and callback url as http://editor.justinechacko.in"

dereklieu commented 6 years ago

@justinechacko the issue is that you haven't built the prose codebase with your client_id and oauth.json settings. It's not enough to just fork the gh-pages branch, since that code has already been pre-bundled. That's why it's giving you the wrong client id in the login link.

You need to checkout prose/master, copy oauth.json into the root directory, and run npm install && npm run build, then deploy the dist folder.

Closing as this no longer pertains to Gatekeeper.