Integrating Microsoft OIDC IdentityServer3 with our own ASP.NET Simple Membership Provider / user database

0
=
0.5
+
0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
0

I have deployed an instance of IdentityServer3 and now I need to customize their default implementation to use our existing user membership database and Simple Membership Provider.

By default, IdentityServer just takes a list of InMemoryUser objects and then just stores that list in memory variable. This, of course, never intended to work for any production implementation b/c you would want your users to be stored in the database and not in a hard-coded list.

Does anyone know what is the easiest way to make IdentityServer work with an existing ASP.NET Simple Membership database of users?

1 Answer

1
=
2
=
$0.5
2 tips with total amount of 1.12 mBTC($0.5 USD) have been sent by lampego

When you want to customize a certain part of IdSrv, implement the right interface and replace the default implementation with yours in repositories.config file which is located in the WebSite project.

In your particular case, you need custom IUserRepository interface implementation, and I suspect you may (or may not) need 2 more interfaces as well - IUserManagementRepository and IClaimsRepository

The IUserRepository interface takes care of authentication:

public interface IUserRepository
{
    bool ValidateUser(string userName, string password);
    bool ValidateUser(X509Certificate2 clientCertificate, out string userName);
    IEnumerable<string> GetRoles(string userName);       
}

Here is an article that explains customization of IdentityServer: http://leastprivilege.com/2013/05/17/customizing-identityserver/

You could also search their website to check other pages relevant to IUserRepository keyword, just copy this to Google Search:

IUserRepository site:leastprivilege.com

.

SEND BITCOIN TIPS
User rating:

thank you for your answer

User rating:

Thanks for your tips

User rating:

Thanks for your tips

0

Too many commands? Learning new syntax?

FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.

Boost your productivity with FavScripts.com!

Post Answer