Setting this whole strategy up
derjp opened this issue · 2 comments
I've been trying to set this strategy up for 3 whole days now, but I can't get it to work. The signon example is not helping me, because it doesn't include a database. I have problems with User.findByOpenID and serializeUser & deserializeUser.
User.findByOpenID:
I get an error saying "User is not defined". What exactly do I have to define?
serializeUser & deserializeUser:
In the signon example the comment says "To support persistent login sessions, Passport needs to be able to serialize users into and deserialize users out of the session. Typically, this will be as simple as storing the user ID when serializing, and finding the user by ID when deserializing. However, since this example does not have a database of user records, the complete Steam profile is serialized and deserialized.
I don't understand what I have to do exactly at this point. I have searched for days but I couldn't find some explanation on how to store the userID when serializing and finding the user by ID when deserializing.
And I know that this isn't an issue with passport-steam, but I just can't get this to work and don't know a better place to ask.. So please don't close this issue
There's some various guides out there I can point you to:
http://destacked.com/2017/04/13/persistent-sessions-passport-js-express-js-session-mysql-js/
http://stackabuse.com/adding-authentication-to-express-with-passport/
https://www.airpair.com/express/posts/expressjs-and-passportjs-sessions-deep-dive
They don't directly address the pain you're facing, but your issue is rather vague without providing a specific storage method for storing sessions.
Sorry for replying late, I was on vacation. I solved this issue around two weeks ago, your resources helped a lot, thanks :) For anyone having similar issues, this tutorial shows exactly how you can implement passport in your app. It is a tutorial for passport-facebook, but passport-steam is very similar:
https://www.youtube.com/watch?v=OMcWgmkMpEE