3

I'm working on an MVC4 site using SimpleMembership to handle user accounts and role based authentication. We have another site and we'd like to implement a single sign on system allowing users from the existing site to log in to the one I am building. What would be the best way to achieve this and hopefully leverage to the existing roles based authorization I'm using on the MVC4 site. Is it possible to have multiple membership providers (i.e. use the built in one and if the user is not found, attempt to authenticate via a custom provider that I'll write (once I work out how!). Or would it be better to abandon the built in membership/roles and roll my own?

I also thought of letting WebSecurity check the local database and if the user is not found, query the 2nd database and if the users credentials are valid, create a local account for them. One issue with this approach is if a user called Fred registers on the MVC site, and then a user from the other site called Fred logs in, we couldn't create them a local account with the same username. We could prefix/suffix the username with some text to indicate that they are from the other site but then we lose the single sign on feature.

We will also want to integrate AD authentication for staff in the future.

So essentially I'm looking for the best way to authenticate users from multiple databases and keep using roles based authentication?

I've also done a little digging was wondering if ADFS might be useful for this.

Any help or advice would be greatly appreciated!

3

1 Answer 1

1

I recommend the use of an Identity server to handle all your login request and switching to a claim based authentication instead of a role based authentication if you can.

I personally went with Thinktecture IdentityServer

pluralsight.com have a good course on it.

Thinktecture IdentityServer is build on top of simple Membership and it supports multiple protocol such as

  1. WS-Federation
  2. WS-Trust
  3. OpenID Connect
  4. OAuth2
  5. ADFS Integration
  6. Simple HTTP

I recommend checking it

Good Luck

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.