How to use external user database and keep the out-of-the-box user permission control functionality

Tom W asked on January 31, 2015 14:40

The user accounts are stored in the database of another system outside of kentico. That system provides registration and verification interfaces for user registration and logon. How to modify kentico's out-of-the-box registration and login components to access those interfaces? At the mean time, I don't want to lose kentico's out-of-the-box user permission control functionality, how to make that?

Correct Answer

Brenden Kehren answered on January 31, 2015 16:20

There are a few things you can do:

  • Create a custom membership provider which would involve a lot of work in my opinion

  • Another option would be to create a custom webpart that performs your authentication as needed. When the user authenticates log in a dummy user that you created in Kentico. So this approach would be ok if you didn't need personalization information or complex access rules. For instance if you had only a few security roles (member and non-member). It would be pretty easy to say all users that are in a "members" role in your custom db belong to "CustomMember" role in Kentico (which really consists of one user and anytime one of those "members" from custom db log in you also log in the "CustomMember" user. I've seen (and done) it this way before but the security was very very simple.

  • Use out of box Kentico membership provider and create a custom event handler to perform the authentication (in both areas) and create that same user in Kentico with similar properties and roles. Yes the same user resides in both places but your authentication method could perform a one way sync (custom db -> Kentico) each time they authenticate. If you have sections which need to perform updates to the members information in the custom db, then handle that in code and create methods to update that other database whenever the user information is updated using an additional custom event handler.

The last way is what I'd recommend as you can handle everything you need much easier and still use all th eout of the box functionality.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Tom W answered on February 3, 2015 10:31

Thank you, will try the last way you recommended.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.