# Change callback url using Actions/Rules

**URL:** <https://community.auth0.com/t/change-callback-url-using-actions-rules/102563>\
**Category:** Get Help\
**Tags:** application, sso\
**Created:** [March 15, 2023, 2:50am UTC](https://community.auth0.com/t/change-callback-url-using-actions-rules/102563 "2023-03-15T02:50:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![parthp](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@parthp](https://community.auth0.com/u/parthp)\
**Post date:** [March 15, 2023, 2:50am UTC](https://community.auth0.com/t/change-callback-url-using-actions-rules/102563/1 "2023-03-15T02:50:07Z")

</div>

Hi,

I have a user in Auth0 that can have an access of multiple websites (e.g. [www.app1.com](http://www.app1.com) and [www.app2.com](http://www.app2.com)) depending on the data stored in user\_data (e.g. app\_data: { subscribed\_site: “app1” } ).

Is it possible to initiate authentication with classic universal login page and use it with custom Action/Rule that can read data from user\_data, check value of specific tag (e.g. if “subscribed\_site” == “app1”) and redirect user to one of the listed callback url of Auth0 application, so that user can login to either app1 (clientId 1) or app2 (clientId 2)?

---

<div class="post-metadata">

**Author:** ![peter.fernandez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter.fernandez/32/45477_2.png) [@peter.fernandez](https://community.auth0.com/u/peter.fernandez)\
**Post date:** [March 15, 2023, 10:08am UTC](https://community.auth0.com/t/change-callback-url-using-actions-rules/102563/2 "2023-03-15T10:08:01Z")

</div>

Hi @parthp

It’s not possible today to change the callback url from within an _Action_ or a _Rule_. Doing something like this would typically be considered an anti pattern as it could potentially lead to undesired consequences (such as potential security issues).

🤔 Also, having some user experience where one logs in to one application but is redirected to another is typically considered counter intuitive. Imaging the users surprise; they’d likely think they mistyped, and probably retry (browser) navigation again.

Assuming that the user isn’t _prevented_ from using an application - as in there is some authorization restriction - then simply using out-of-box SSO (see [How to Implement Single Sign On](https://auth0.com/learn/how-to-implement-single-sign-on) for details) would typically suffice. If there are authorization restrictions then you can certainly use an _Action_ or a _Rule_ to prevent token(s) being generated.

However, if you do have a definite need to solve for this use case, then your best approach would be to have all applications defined with a single callback, and then implement custom logic in that callback - e.g. using some (custom) claim in the token - to perform the final redirect to the intended destination. You can easily add additional (custom) claims to a token by following the guidance provided [here](https://auth0.com/docs/secure/tokens/json-web-tokens/create-custom-claims).

Hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![parthp](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@parthp](https://community.auth0.com/u/parthp)\
**Post date:** [March 15, 2023, 10:23am UTC](https://community.auth0.com/t/change-callback-url-using-actions-rules/102563/3 "2023-03-15T10:23:30Z")

</div>

What you are saying perfectly makes sense Peter. Odd it is, but this is a business requirement for a valid reason. Also, we cannot have same callback url for multiple partner applications.

But I found a way to resolve the issue 🙂 using intermediate application that decides the target application and then initiate the silent authentication. So, all good.

Thank you for the confirmation though.

---

<div class="post-metadata">

**Author:** ![peter.fernandez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter.fernandez/32/45477_2.png) [@peter.fernandez](https://community.auth0.com/u/peter.fernandez)\
**Post date:** [March 15, 2023, 2:52pm UTC](https://community.auth0.com/t/change-callback-url-using-actions-rules/102563/4 "2023-03-15T14:52:45Z")

</div>

You’re welcome @parthp; glad to hear you got it sorted 🕶

---

<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:** [November 19, 2024, 10:25pm UTC](https://community.auth0.com/t/change-callback-url-using-actions-rules/102563/5 "2024-11-19T22:25:59Z")

</div>

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