IdenityServer in an enterprise environment - Resolve user information across multiple databases

114 views Asked by At

We use the IdentityServer3 as our central authentication provider. Now I have a general question about the IdenityServer in an enterprise environment. I try to explain it with the following example:

  1. If a user was successfully authenticated, he get a token from the provider. The token includes the unique ID of the user.
  2. The authenticated user send a request to a WebApi, to create a new item (e.g a new product).
  3. The WebApi extract the unique ID from the token and creates the new product in the database. Additionally the new product was linked with the unique user ID (e.g as creationUserId).
  4. An other user send a request to the WebApi to get all available products.
  5. The WebApi create a database query to retrieve all products. Additionally the WebApi wants to convert the creationUserId of each product to the correlating username. But that is not possible, because username is stored in the identity database which is an other database one than the application database (e.g for the products). Are there some best practices to solve this requirement?

Many thanks for your help!

Regards

1

There are 1 answers

0
Martin Schagerl On

Thank you for your answers. I see only one way to realize my requirements:

--> I store the username with the userId in the application database, because a API for translating is to slow.