# Switch user organisation without re-login

**URL:** <https://community.auth0.com/t/switch-user-organisation-without-re-login/84183>\
**Category:** Get Help\
**Created:** [May 27, 2022, 5:48pm UTC](https://community.auth0.com/t/switch-user-organisation-without-re-login/84183 "2022-05-27T17:48:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fiodor](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/fiodor/32/28930_2.png) [@fiodor](https://community.auth0.com/u/fiodor)\
**Post date:** [May 27, 2022, 5:48pm UTC](https://community.auth0.com/t/switch-user-organisation-without-re-login/84183/1 "2022-05-27T17:48:28Z")

</div>

I’m using the embedded login with auth0-js.

I have a user who is a member of two different organisations.

The user goes to my login page, where they identify which organisation they want to log into. Next they input their email and password. Then the WebAuth.login method is called with the supplied credentials and `organisation_id`. My backend receives the `code` which it then uses to obtain the `access_token` and the `refresh_token`, and uses the `access_token` to retrieve the user’s info.

Now I want to let the user easily switch to another organisation, without having to input their credentials again.

Is there any way I can exchange the `access_token` and/or `refresh_token` for a new pair of tokens for the same user, but in a different organisation?

---

<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:** [June 1, 2022, 11:45pm UTC](https://community.auth0.com/t/switch-user-organisation-without-re-login/84183/3 "2022-06-01T23:45:12Z")

</div>

Hi there @fiodor welcome to the community!

> [@fiodor](#):
>
> Is there any way I can exchange the `access_token` and/or `refresh_token` for a new pair of tokens for the same user, but in a different organisation?

You should be able to accomplish this using [silent authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication) - In particular, you will need to utilize the `prompt` param of [webAuth.authorize()](https://auth0.com/docs/libraries/auth0js#login)

Hope this helps get the ball rolling!

---

<div class="post-metadata">

**Author:** ![fiodor](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/fiodor/32/28930_2.png) [@fiodor](https://community.auth0.com/u/fiodor)\
**Post date:** [June 3, 2022, 9:22am UTC](https://community.auth0.com/t/switch-user-organisation-without-re-login/84183/4 "2022-06-03T09:22:36Z")

</div>

Hi @ty.frith.

I have tried this method already, but it does not work in my case. There’s no way to explicitly pass `access_token` or `refresh_token` to this method (I’m assuming it expects cookies set by universal login). When I tried it I got an error to the tune of “authentication required”.

---

<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:** [June 18, 2022, 9:23am UTC](https://community.auth0.com/t/switch-user-organisation-without-re-login/84183/5 "2022-06-18T09:23:11Z")

</div>

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