# Generate id\_token

**URL:** <https://community.auth0.com/t/generate-id-token/8845>\
**Category:** Get Help\
**Tags:** id\_token\
**Created:** [November 29, 2017, 6:48am UTC](https://community.auth0.com/t/generate-id-token/8845 "2017-11-29T06:48:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joe1](https://community.auth0.com/u/joe1)\
**Post date:** [November 29, 2017, 6:48am UTC](https://community.auth0.com/t/generate-id-token/8845/1 "2017-11-29T06:48:30Z")

</div>

Is there a way to obtain id\_token programatically? The purpose is to test our API..flow is : front-end uses Auth0 to get an id\_token then we are using delegation to get AWS tokens.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [November 29, 2017, 5:15pm UTC](https://community.auth0.com/t/generate-id-token/8845/2 "2017-11-29T17:15:28Z")

</div>

It is possible, although under specific circumstances. In particular, if you a database connection end-user then you can exchange the username and password for tokens through an endpoint that does not require end-user interaction and as such can be performed programatically.

Given you’re using the legacy delegation flows you should take a look at the also legacy `/oauth/ro` [endpoint](https://auth0.com/docs/api/authentication?http#resource-owner) which allows to perform the exchange described above. Have in mind that even if your production users only use social authentication you can consider having a database connection in your test tenant/domain so that you can perform such programmatic tests.

---

<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:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/generate-id-token/8845/3 "2018-03-02T05:57:34Z")

</div>


