-2

I am applying my custom database with authentication process, and now I am gonna use Identity server for authentication process.

but I got confused to have 2 databases, authentication database for identity server project, and main database for web api project.

because both databases have User Table? I am confused, please can you help understand each DB's infrastructure ?

Added Info: I am asking about a concept, I don't want any code: I am confused where to place my User Table, should I place it in Authentication DB or should I place it in WEB API's DB.

in case it's been placed in Identity Sever Auth DB, is it OK to make Crud operation to the Auth DB ?

Hisham Aburass
  • 606
  • 1
  • 8
  • 15
  • 1
    Perhaps my answer [here](https://stackoverflow.com/questions/52079466/is-claims-based-authorization-appropriate-for-individual-resources/52100609#52100609) can help you with this. –  Jun 16 '19 at 21:18

1 Answers1

2

There won't be an actual link between the entities from two individual databases, you'll have to create/manage that association within your application.

In your application db, within User table, you can add a column to store the Identity User Id from the Identity Server's database. That way you can have some sort of association between your Identity Users and your Application Users within your application.

When the user logs into Identity and the login request is resolved to your Application, you'll look up the Application User in your application's database that has the same Identity User Id as what was resolved from Identity Server.

Joshua Sprague
  • 350
  • 2
  • 6