# Route user to different web apps based on Auth0 custom claims value

**URL:** <https://community.auth0.com/t/route-user-to-different-web-apps-based-on-auth0-custom-claims-value/128718>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [March 1, 2024, 1:32pm UTC](https://community.auth0.com/t/route-user-to-different-web-apps-based-on-auth0-custom-claims-value/128718 "2024-03-01T13:32:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dheeraj.awale](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dheeraj.awale](https://community.auth0.com/u/dheeraj.awale)\
**Post date:** [March 1, 2024, 1:32pm UTC](https://community.auth0.com/t/route-user-to-different-web-apps-based-on-auth0-custom-claims-value/128718/1 "2024-03-01T13:32:42Z")

</div>

Requirement:

1. User is given a gateway web application URL where he continues with the Auth0 Login.
2. Upon successful authentication, application will read the claims.  
2.1 If claims has ‘admin’ value then application should redirect the user to admin web  
application which is in [asp.net](http://asp.net) mvc.  
2.2 If claims has ‘reader’ value then application should redirect the user to reader web  
application which is react app.
3. These redirected web applications should just validate the user token with Auth0, save it and then Authorize the user.
4. If the token expires, user should be redirect to Gateway web application.

PFA Diagram:

![Auth_Routing](https://global.discourse-cdn.com/auth0/original/3X/6/4/6425f0c1d73e2d648ce3943effa3484e8ef0aa46.png)

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 1, 2024, 10:03pm UTC](https://community.auth0.com/t/route-user-to-different-web-apps-based-on-auth0-custom-claims-value/128718/3 "2024-03-01T22:03:39Z")

</div>

Hi @dheeraj.awale,

Your use case should be possible. Once the user has fully authenticated and redirects to your callback URL, you can decode the token and then redirect them to your preferred application based on the claims.

You will have to perform a redirect twice.

I hope this helps!

Cheers,  
Rueben

---

<div class="post-metadata">

**Author:** ![dheeraj.awale](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dheeraj.awale](https://community.auth0.com/u/dheeraj.awale)\
**Post date:** [March 4, 2024, 5:23am UTC](https://community.auth0.com/t/route-user-to-different-web-apps-based-on-auth0-custom-claims-value/128718/4 "2024-03-04T05:23:05Z")

</div>

Thanks @rueben.tiow , I am able to redirect (twice). But I am not able to figure out how to validate (or revalidate) the token in preferred application without having user to re-challenge the auth0.  
Can you please give me some direction on ‘how to JUST validate the token I received form Auth code flow?’

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 4, 2024, 6:10pm UTC](https://community.auth0.com/t/route-user-to-different-web-apps-based-on-auth0-custom-claims-value/128718/6 "2024-03-04T18:10:47Z")

</div>

Hi @dheeraj.awale,

Thanks for the reply.

Sure! You can validate the access token by using any [third-party libraries from JWT.io](https://jwt.io/libraries).

Please refer to our [Validate JSON Web Tokens](https://auth0.com/docs/secure/tokens/json-web-tokens/validate-json-web-tokens) documentation for more information.

Thanks,  
Rueben

---

<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 18, 2024, 6:11pm UTC](https://community.auth0.com/t/route-user-to-different-web-apps-based-on-auth0-custom-claims-value/128718/7 "2024-03-18T18:11:46Z")

</div>

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