Orchard CMS custom membership

孤人 提交于 2019-12-22 06:34:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/10171727/orchard-cms-custom-membership

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!