0

In all the examples that I saw regarding thinktecture I saw that they are using InMemoryUserobject to represent the users. is this also suitable for production code? how should I do it?

Tsahi
  • 445
  • 4
  • 22

1 Answers1

1

From the Identity Server documentation:

This is only suitable for testing and development - In-Memory Services and Stores

You will need an implementation of the UserService to replace this.

They also have some general guidelines for deployment you should check out before deploying to production.

Scott Brady
  • 5,498
  • 24
  • 38
  • Hi Scott, In my case the users are stored in DB and managed manually by our application. what are the cons of getting the users from DB and convert them to In-Memory users? – Tsahi Jan 13 '16 at 12:49
  • If you use the in-memory services and in turn users, this would involve a static list of users. In other words a full database read into memory. Not good. You will need to implement IUserService to read from your application database. There are existing implementations for ASP.NET Identity and MembershipReboot that you can use as a guideline/inspiration. – Scott Brady Jan 13 '16 at 13:04
  • Yes, I know that they are ASP.NET Identity and MembershipReboot but we currently don't use them. You're saying that it's not good because of the size of the list? Can I tell the list to refresh itself in case changes were done to the users? – Tsahi Jan 13 '16 at 13:34
  • I think the concept of reading a database into memory is the subject of a separate Stack Overflow question. The recommended approach for your question is a custom UserService. The authors of Identity Server recommend you don't use In-Memory user services or stores in production. – Scott Brady Jan 15 '16 at 13:14