# Generating per-user API keys for services

**URL:** <https://community.auth0.com/t/generating-per-user-api-keys-for-services/101844>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [March 5, 2023, 7:01pm UTC](https://community.auth0.com/t/generating-per-user-api-keys-for-services/101844 "2023-03-05T19:01:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hktestuser](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hktestuser](https://community.auth0.com/u/hktestuser)\
**Post date:** [March 5, 2023, 7:01pm UTC](https://community.auth0.com/t/generating-per-user-api-keys-for-services/101844/1 "2023-03-05T19:01:48Z")

</div>

Hello, I am new to auth0 and looking for some help with the following use case -  
We have a service that is accessed through a library that we distribute to users and which the users can integrate into their applications. We would like to support auth for this case. Ideally, we would like to let each user generate an API key that they can pass into our library. I looked through the forum posts and came across this one - [https://community.auth0.com/t/how-to-generate-tokens-for-api-users](https://community.auth0.com/t/how-to-generate-tokens-for-api-users) - it sounds like this is not a use case that is directly supported in auth0.  
Is there a way we can make auth0 work for the case where we distribute a library to the user? What auth flow should I use in this case? Any pointers would be much appreciated!

Thank you!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 8, 2023, 1:25am UTC](https://community.auth0.com/t/generating-per-user-api-keys-for-services/101844/3 "2023-03-08T01:25:25Z")

</div>

Hey there @hktestuser welcome to the community!

> [@hktestuser](#):
>
> Is there a way we can make auth0 work for the case where we distribute a library to the user? What auth flow should I use in this case? Any pointers would be much appreciated!

You might be able to achieve something similar using an M2M approach outlined in this post:

> [@Implementing personal access token](https://community.auth0.com/t/implementing-personal-access-token/89651/4):
>
> Hey @amit9 - The only possible approach I’m aware of currently would be essentially using client credentials via an M2M app per user. Outside of that it’s not something that’s supported for the time being. I saw that you added to the feedback request, thanks for that!

I also definitely recommend adding your input to the following feedback request as this is a common ask:

> [@Personal Access Tokens or API Keys](https://community.auth0.com/t/personal-access-tokens-or-api-keys/77922):
>
> Feature: Personal Access Tokens or API Keys Description: Often, one wants to grant users access to the API without requiring a typical log in flow. This is either because users want to grant trusted third parties or themselves access in a programmatic setting where a typical login flow would not make sense. For example, GitHub generates personal access tokens which can be used to access the API, and can be revoked. Use-case: This is a use case useful for not pushing the burden of logging in t…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 28, 2023, 10:51pm UTC](https://community.auth0.com/t/generating-per-user-api-keys-for-services/101844/4 "2023-04-28T22:51:57Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
