{"action":"opened","issue":{"url":"https://api.github.com/repos/krakenjs/kraken-example-with-passport/issues/12","labels_url":"https://api.github.com/repos/krakenjs/kraken-example-with-passport/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/krakenjs/kraken-example-with-passport/issues/12/comments","events_url":"https://api.github.com/repos/krakenjs/kraken-example-with-passport/issues/12/events","html_url":"https://github.com/krakenjs/kraken-example-with-passport/issues/12","id":88580212,"number":12,"title":"Attempt to add OAuth2 strategy and fails","user":{"login":"mikesparr","id":5553105,"avatar_url":"https://avatars.githubusercontent.com/u/5553105?v=3","gravatar_id":"","url":"https://api.github.com/users/mikesparr","html_url":"https://github.com/mikesparr","followers_url":"https://api.github.com/users/mikesparr/followers","following_url":"https://api.github.com/users/mikesparr/following{/other_user}","gists_url":"https://api.github.com/users/mikesparr/gists{/gist_id}","starred_url":"https://api.github.com/users/mikesparr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikesparr/subscriptions","organizations_url":"https://api.github.com/users/mikesparr/orgs","repos_url":"https://api.github.com/users/mikesparr/repos","events_url":"https://api.github.com/users/mikesparr/events{/privacy}","received_events_url":"https://api.github.com/users/mikesparr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-16T01:02:17Z","updated_at":"2015-06-16T01:02:17Z","closed_at":null,"body":"Is there a way to extend this example to show a common OAuth2 strategy?  I upgraded to the latest KrakenJS and rebuilt the controllers from pre 1.x version app, and changed auth.js and other `/lib/` files like spec.js, crypto.js, user.js.\r\n\r\nNow if I wanted to use an OAuth strategy I assumed all I would have to do was:\r\n\r\n * npm install the additional strategy module\r\n * add the strategy export to `auth.js`\r\n * change the `spec.js` to use the new strategy export from `auth.js`\r\n * add callback route with passport.authorize({some strategy name}, ...) that redirects to logged in view\r\n\r\nEvery step of the way the app failed, complaining about one thing after another. I finally had to comment out all the spec.js and user.js mentions and create a new oauth.js lib and import in index.js main server file.  It still failed complaining about not finding the strategy name.\r\n\r\nI then imported passport in index.js and declared it to `.use(new strategy export)` and it got further and now I get the following errors:\r\n\r\n ~~~\r\nInternal server error\r\n\r\nThe URL /auth/callback?code=zrmmdTI1j2QSP2Ht had the following error failed to obtain access token (status: 403 data: {\"error\":\"invalid_grant\",\"error_description\":\"Invalid authorization code\"})\r\n~~~\r\n\r\nI then added `express-session` and `cookie-parser` thinking for some reason during redirects it was losing the code or token, but still same error.  Is there any way to extend this app and show a working example of a popular OAuth strategy instead of just the Mongo-based local strategy so others can see what might be wrong or what missing pieces or NPM dependencies Kraken needs?\r\n\r\nThanks so much!"}}