# Recommended way to get access and id token of an authenticated user for E2E testing

**URL:** <https://community.auth0.com/t/recommended-way-to-get-access-and-id-token-of-an-authenticated-user-for-e2e-testing/133357>\
**Category:** Get Help\
**Tags:** regular-database-connections, connections\
**Created:** [May 3, 2024, 7:36pm UTC](https://community.auth0.com/t/recommended-way-to-get-access-and-id-token-of-an-authenticated-user-for-e2e-testing/133357 "2024-05-03T19:36:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![send2hiday](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/send2hiday/32/56847_2.png) [@send2hiday](https://community.auth0.com/u/send2hiday)\
**Post date:** [May 3, 2024, 7:36pm UTC](https://community.auth0.com/t/recommended-way-to-get-access-and-id-token-of-an-authenticated-user-for-e2e-testing/133357/1 "2024-05-03T19:36:15Z")

</div>

My Auth0 application is configured with grants shown below (Enabling password grant is not recommended).

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/6/8674ce9ef731fb905b826a04287d3648efd37d2d.png)

What is the best way to get the access\_token and id\_token in order to test the auth0 profile updates of users in Cypress E2E .

---

<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:** [May 7, 2024, 5:53pm UTC](https://community.auth0.com/t/recommended-way-to-get-access-and-id-token-of-an-authenticated-user-for-e2e-testing/133357/3 "2024-05-07T17:53:45Z")

</div>

Hey there @send2hiday welcome to the community!

Using the password grant for testing purposes should be totally fine, and much more simple to implement. I would probably create an entirely separate database connection in your tenant to use specifically for testing purposes.

---

<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:** [May 21, 2024, 5:54pm UTC](https://community.auth0.com/t/recommended-way-to-get-access-and-id-token-of-an-authenticated-user-for-e2e-testing/133357/4 "2024-05-21T17:54:23Z")

</div>

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