# Get user token (by email and password) from the API

**URL:** <https://community.auth0.com/t/get-user-token-by-email-and-password-from-the-api/77391>\
**Category:** Get Help\
**Created:** [February 1, 2022, 8:11am UTC](https://community.auth0.com/t/get-user-token-by-email-and-password-from-the-api/77391 "2022-02-01T08:11:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![israelk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/israelk/32/34824_2.png) [@israelk](https://community.auth0.com/u/israelk)\
**Post date:** [February 1, 2022, 8:11am UTC](https://community.auth0.com/t/get-user-token-by-email-and-password-from-the-api/77391/1 "2022-02-01T08:11:16Z")

</div>

_my use case_: I develop an E2E test for our application  
In the beginning of the test I create a user in auth0 via the api  
(first of all I get the API access token via `/oauth/token` and than I create a user via a POST request to `/api/v2/users` )  
at the end of the tests I want to send a request to **my** backend, but for that I need to send an `authorization` header with a bearer-token

So my question is how can I get this bearer-token via the API (I didn’t found any API that I cant send an email and password and get the token back)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 3, 2022, 10:20pm UTC](https://community.auth0.com/t/get-user-token-by-email-and-password-from-the-api/77391/3 "2022-02-03T22:20:51Z")

</div>

Hi @israelk,

Welcome to the Auth0 Community!

You can get access tokens directly in exchange for username/password with the password grant.

More info on how to do that here: [Is there an easy way to get a user access token for testing?](https://community.auth0.com/t/is-there-an-easy-way-to-get-a-user-access-token-for-testing/73170)

---

<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:** [February 18, 2022, 10:21pm UTC](https://community.auth0.com/t/get-user-token-by-email-and-password-from-the-api/77391/4 "2022-02-18T22:21:27Z")

</div>

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