Giter Club home page Giter Club logo

react-auth-server's People

Contributors

funador avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-auth-server's Issues

my terminal responded this

/Users/maherbhavsar/webprj/react-auth-server/node_modules/passport-oauth1/lib/strategy.js:83
if (!options.consumerKey) { throw new TypeError('OAuthStrategy requires a consumerKey option'); }

is authenticated middleware

I was having a lot difficult to implement social login with my app, and you have already helped a lot, thanks! and I have already prototyped my own version and it works!

But how would you recommend me to make a middleware to check if the access_token being sent from my frontend is valid?

I am aware about google tokeninfo route that returns some data if we send a valid access_token and facebook has the sema approach. would you recommend to validate the request using those routes or there is something else?

google route: /oauth2/v1/tokeninfo?access_token=accessToken
facebook route: /me?access_token=xxxxxxxxxxxxxxxxx
github: GET /applications/:client_id/tokens/:access_token

sorry if I sound like noob, but I am :D

Facebook session.socketid undefined

Hello,

I have integrated your approach into my application and it appears to work well for Twitter, Google and Github. Your version works when i check it out and run it on my local machine.

When running my version of the code, i find that Facebook fails. Your repo is different from the article and i have followed the changes from the repo with the middleware for session storage.

The facebook user is returned and i can see the data in the console if i output it. However, the session does not contain the socket Id.

Is there anything special about Facebook which might be wrong here? I am using HTTPS.

Outputting the values

Logging the socketId in the router middleware.

router.use((req, res, next) => {
  console.log("Add socket to session");
  console.log(req.query.socketId);
  req.session.socketId = req.query.socketId
  next()
})

Logging the socketId in the callback.

exports.facebook = (req, res) => {
  const io = req.app.get('io')
  const { givenName, familyName } = req.user.name
  const user = { 
    name: `${givenName} ${familyName}`,
    photo: req.user.photos[0].value
  }
  console.log("Facebook user");
  console.log(req.session.socketId);   // This returns as undefined!
  io.in(req.session.socketId).emit('facebook', user);
  res.end();
}

Output for Google

[0] Add socket to session
[0] WuBItRcIskcXEy02AAAB
[0] Google user
[0] WuBItRcIskcXEy02AAAB

Output for Facebook

[0] Add socket to session
[0] WuBItRcIskcXEy02AAAB
[0] Facebook user
[0] undefined

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.