Open i-ask-too-many-questions opened 9 years ago
Strategies are only used for authenticating, not generating api keys. An easy solution to this problem is to create a route that accepts user credentials and uses another passport strategy(maybe use the local strategy), and then return an api key for others to use via a post or get request. Finally, the next step is to use this strategy for authentication purposes and protecting other parts of an api.
I suggest using https://github.com/substack/node-hat to generate API keys then store them in your database along with the user's details
The example shows two pre-generated api keys to use for authentication purposes. I need new users to sign up and have new api keys generated for them. Is this possible? And if so, how? Thank you.