質問

I need to generate a token once my users have authenticate with a 3rd party(Facebook, or Twitter). I will give this token back to the client and they will be able to access all the users information using it.

I need the token to be hard to guess and hard to predict. (Hard meaning it would take a day or two to guess with a modern desktop)


MySQL has the function UUID() that generates a value that is unique but the documentation also says its not unguessable or unpredictable. I'm not sure if that means it's not hard to guess or predict.

役に立ちましたか?

解決

There are tons of node.js modules, that do exactly what you need. Popular picks:

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top