# How to get user jwt token without password?

**URL:** <https://community.auth0.com/t/how-to-get-user-jwt-token-without-password/121113>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [November 17, 2023, 1:37pm UTC](https://community.auth0.com/t/how-to-get-user-jwt-token-without-password/121113 "2023-11-17T13:37:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amakarov](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@amakarov](https://community.auth0.com/u/amakarov)\
**Post date:** [November 17, 2023, 1:37pm UTC](https://community.auth0.com/t/how-to-get-user-jwt-token-without-password/121113/1 "2023-11-17T13:37:31Z")

</div>

I want to create a user in auth0 database. But this user shouldn’t have password.

These users redirect to us from other system and we should give them our auth0 token and allow them to log in.

We don’t want to save their password in our database. We have user email, we have  
clientId, clientSecret.

Do we can generate aceess, referesh tokens for user using clientId and secrets?  
Or maybe generate managment api key and then query some endpoint?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 17, 2023, 5:24pm UTC](https://community.auth0.com/t/how-to-get-user-jwt-token-without-password/121113/3 "2023-11-17T17:24:09Z")

</div>

Hi @amakarov,

Welcome to the Auth0 Community!

Unfortunately, you cannot create a database user without a password. You could always use a dummy password if needed or opt for an alternative connection method to login, like Passwordless.

Now, after reviewing your use-case, it seems that you might be interested in the [client credentials flow](https://auth0.com/docs/authorization/flows/call-your-api-using-the-client-credentials-flow). The client credentials flow is used to generate an access token for an application requesting access to a protected resource and it does not involve any user interaction.

If you’re looking to use the Management API, you can follow our [documentation](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-access-tokens-for-production) on getting access tokens for the Management API using the client credentials flow.

Reference Materials:

- [Which OAuth 2.0 Flow Should I Use?](https://auth0.com/docs/get-started/authentication-and-authorization-flow/which-oauth-2-0-flow-should-i-use)

Please let me know if you have any questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![amakarov](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@amakarov](https://community.auth0.com/u/amakarov)\
**Post date:** [November 20, 2023, 3:25pm UTC](https://community.auth0.com/t/how-to-get-user-jwt-token-without-password/121113/4 "2023-11-20T15:25:07Z")

</div>

Hi @rueben.tiow. Thanks for your answer.

The link that you shared creates credentials for managing my API.  
We already have a machine-to-machine application.

We want to query `${endpoint}/oauth/token` because it will trigger post-login action and call our API where we put all customer metadata into metadata and pass it to jwt token.

So when a third party calls API with email we want to return an access token for this token but not keep the password in the database. So the [Client Credential flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-client-credentials-flow?_gl=1*b3czcf*_gcl_au*MTM3OTcxMDA2My4xNjk1MjE5MjE3*_ga*MTU2MzU5MjcxMS4xNjk1MjE5MjE4*_ga_QKMSDV5369*MTcwMDQ5MjgxMC4yMC4xLjE3MDA0OTMyODIuNjAuMC4w) won’t help because it gives access to management API. But we need user access token with user metadata.

Do you have any examples of how to implement such a flow? Because our provider doesn’t have a generating token for the user. They only redirect them to us.  
Maybe you can share url to some examples? As I mentioned we have client id and secrets

Even in case if we need create user in auth0 with database how then login into auth0 if we don’t want to store password in database?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 28, 2023, 7:52pm UTC](https://community.auth0.com/t/how-to-get-user-jwt-token-without-password/121113/5 "2023-11-28T19:52:28Z")

</div>

Hi @amakarov,

Thank you for the reply.

> [@amakarov](#):
>
> But we need user access token with user metadata.
> 
> Do you have any examples of how to implement such a flow?

Yes, you can use the authorization code flow to do this. See our [Call Your API Using the Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow) documentation on this.

> [@amakarov](#):
>
> Even in case if we need create user in auth0 with database how then login into auth0 if we don’t want to store password in database?

You could use a Passwordless login for this scenario.

---

<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:** [December 12, 2023, 7:52pm UTC](https://community.auth0.com/t/how-to-get-user-jwt-token-without-password/121113/6 "2023-12-12T19:52:55Z")

</div>

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