# Token Exchange implementation

**URL:** <https://community.auth0.com/t/token-exchange-implementation/124573>\
**Category:** Get Help\
**Tags:** client-grants, management-api\
**Created:** [January 10, 2024, 5:39pm UTC](https://community.auth0.com/t/token-exchange-implementation/124573 "2024-01-10T17:39:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdong-amb](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jdong-amb/32/49904_2.png) [@jdong-amb](https://community.auth0.com/u/jdong-amb)\
**Post date:** [January 10, 2024, 5:39pm UTC](https://community.auth0.com/t/token-exchange-implementation/124573/1 "2024-01-10T17:39:46Z")

</div>

We are building a healthcare application in an embedded browser in an Electronic Medical Record (EMR).

We are looking to implement an auth flow where (using SMART on FHIR) the browser fetches an auth token from the EMR, forwards it to our server, our server validates the token, our server maps the token’s corresponding EMR identity to an identity in Auth0, then our server issues a new Auth0 user token for the browser. I understand that this could be implemented using on-behalf-of token exchange, or a management API that issues individual user auth tokens (which I was not able to find).

What does Auth0 recommend to implement this auth flow? In particular, I was not able to find a way to issue a new Auth0 user token from a trusted server given an Auth0 ID.

Thanks,  
Josh

---

<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:** [January 18, 2024, 10:24pm UTC](https://community.auth0.com/t/token-exchange-implementation/124573/3 "2024-01-18T22:24:55Z")

</div>

Hi @jdong-amb,

Welcome to the Auth0 Community!

Auth0 doesn’t support _user impersonation_ (getting a user token from a management API) and the flow you describe isn’t going to be readily available.

Hope this helps!

---

<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 1, 2024, 10:25pm UTC](https://community.auth0.com/t/token-exchange-implementation/124573/4 "2024-02-01T22:25:06Z")

</div>

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