Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Orchard CMS custom membership

Tags:

orchardcms

What is the preferred way of integrating a custom membership provider with Orchard?

I have seen a couple of posts around implementing a new IMembershipService and IUserService (from Orchard.Users) and then there other modules such as OpenAuthentication which seem to do a lot more than that (but still uses the UserPart??).

We already have an ASP.NET Membership provider written, can this be integrated as is?

like image 987
Oll Avatar asked Apr 16 '12 09:04

Oll


1 Answers

Custom implementation of IMembershipService is a way to go if you don't want to use the default Orchard.Users module at all. Useful when you still want to do forms authentication, but just store the auth data somewhere else, not in UserPart.

If you would like to create a totally custom authentication scheme, that overrides the form-based default one (username + password), override IAuthenticationService.

So, generally speaking:

  • IMembershipProvider is about authentication data management (create/retrieve users)
  • IAuthenticationProvider is about performing the authentication (sign in/out/get current user etc.)

Depending on your needs you can override either one or both.

The common auth modules, like the OpenAuth one, add additional authentication options to the existing default one without actually replacing it, IIRC.

like image 167
Piotr Szmyd Avatar answered Sep 25 '22 02:09

Piotr Szmyd