# Handling separated databases

**URL:** <https://community.auth0.com/t/handling-separated-databases/59024>\
**Category:** Get Help\
**Tags:** csharp, rules, aspnet-core, sqlserver, auth0\
**Created:** [March 7, 2021, 8:01am UTC](https://community.auth0.com/t/handling-separated-databases/59024 "2021-03-07T08:01:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal.ali.habashi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jamal.ali.habashi/32/25369_2.png) [@jamal.ali.habashi](https://community.auth0.com/u/jamal.ali.habashi)\
**Post date:** [March 7, 2021, 8:01am UTC](https://community.auth0.com/t/handling-separated-databases/59024/1 "2021-03-07T08:01:20Z")

</div>

Hello,  
It’s my first time using Auth0 and I have some troubles understanding some concepts, but my biggest concern is how should I handle separated Databases.

If I have a customer, which is stored in Auth0 database, how can I assign a ticket/department/manager for this customer. I do have some work arounds like getting his email and store it in my database as customer Id, but I think that this is not the right way to do it.

- Clarification:  
Before using Auth0, I was using Sql database and I was storing the identity database and any other related tables in the same database.

So can you guide me to any article or any thing that explains my concern.

Thank you so much!

---

<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:** [March 8, 2021, 11:05pm UTC](https://community.auth0.com/t/handling-separated-databases/59024/3 "2021-03-08T23:05:09Z")

</div>

Hi @jamal.ali.habashi,

You can use the user\_id (the `sub` claim in the token) as a unique identifier for your user. Here is a thread that talks about it:

> [@How to link JWT to my users info database](https://community.auth0.com/t/how-to-link-jwt-to-my-users-info-database/52201/12):
>
> I use React SDK, if there is no solution to the problem I will have to use the email as an identifier.

---

<div class="post-metadata">

**Author:** ![jamal.ali.habashi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jamal.ali.habashi/32/25369_2.png) [@jamal.ali.habashi](https://community.auth0.com/u/jamal.ali.habashi)\
**Post date:** [March 9, 2021, 12:57am UTC](https://community.auth0.com/t/handling-separated-databases/59024/4 "2021-03-09T00:57:52Z")

</div>

How can I store the ID in my local database once the user registered or logged in for the first time?

I tried to use the rules and apply this article, by redirecting the user to another registration page in which I can get the information that is not related to the authentication process.

[Redirect Users From Within Rules (auth0.com)](https://auth0.com/docs/rules/redirect-users?_ga=2.221707800.1494542246.1615053627-17641596.1614198578#security-considerations)

but it turns out that I can’t send any parameter(userId) in the redirection url, should I use hooks instead?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![jamal.ali.habashi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jamal.ali.habashi/32/25369_2.png) [@jamal.ali.habashi](https://community.auth0.com/u/jamal.ali.habashi)\
**Post date:** [March 9, 2021, 1:42am UTC](https://community.auth0.com/t/handling-separated-databases/59024/5 "2021-03-09T01:42:10Z")

</div>

It took me about 2 hours to figure it out ☹ . The ID contains a special character “|” that cannot be sent in the URL. I handled it. I am not sure if what I am doing is the right way to do it.

Thanks

---

<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 24, 2021, 1:42am UTC](https://community.auth0.com/t/handling-separated-databases/59024/6 "2021-03-24T01:42:17Z")

</div>

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