Replies: 2 comments 6 replies
-
Hey @gotleg — thank you for the compliments! I am not sure I understand your questions. You do have to generate an API key for each user that requires one, but I am not sure why you'd need each user to instantly have an API key. Users can log in via JWT without generating an API key, which is the normal way for users to authenticate, and API keys are more of a way for your third-party apps and integrations to be able to auth with Payload directly without having to log in before making requests. Typically you only have a small handful of API keys (maybe one for each service that is integrating with Payload). But, if you wanted to auto-generate an API key for each user in a collection (or multiple collections), you could by simply writing a Node script that uses Payload's Local API to update all users with Let me know if I am misunderstanding here. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
This pattern still seems a bit off to me but please feel free to correct my understanding if I'm way off-base (I'm testing using the website template):
A more common pattern I've seen with API tokens (tailored to this situation):
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm testing payloadcms for a few hours and so far, everything is pretty straight forward. Nice job :)
I read the doc about enabling api-key auth on a collection, but once it's done, I have to generate an api-key for each document !?!
Is there a way to generate an api-key for one user but on an entire collection and even better for multiple collections ?
I want to be able to list all items in a collection (ex: /api/menu)
Can't find a way to do so in the docs. Do I miss something ?
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions