OutOFTouch
OutOFTouch

Reputation: 1077

How do I create the database for IdentityManager and IdentityServer?

I have downloaded the samples from the IdentityServer3 github repo and ran the MembershipReboot project, I changed the connection string to point to a real server but I still don't see how to get it create the database, I thought this used EF code first to do this. I just feel lost right now trying to understand how to use IdMgr and IdSvr.

Upvotes: 0

Views: 3844

Answers (1)

Yoad Snapir
Yoad Snapir

Reputation: 538

You were right, The IDS MembershipReboot project relies on MembershipReboot which in itself uses EF migration scripts to generate the database if it doesn't exist (or upgrade it if it's an old one).
But, note that you need the connection string to use a user with permissions to create the database and tables in it.

Also, as far as I can remember you need to actually hit the (IDS) server with a request to get things spin up and create the DB. Otherwise, IDS would not load anything from the IoC container and the DbContext would not get created. But this is something I cannot verify now.

The configuration database of IDS (scopes, clients, claims etc.) is stored in-memory in the MembershipReboot sample you are using. It could be stored in MSSQL using EF (or any other store if you care to implement it). You can see a working sample that uses EF and MSSQL in the EntityFramework sample project. I guess you can combine the two samples get what you are after.

Upvotes: 1

Related Questions