Orchard CMS with windows auth?

∥☆過路亽.° 提交于 2019-12-13 07:38:00

问题


Can Orchard work with AD and Windows authentication? I need to allow only specific AD groups access to a blog. The rest of the site should be accessible to any valid domain user. The admin dashboard should only be accessible by another specific AD group.

[ update ]
At the suggestion of ViRuSTriNiTy, I tried the following:
- install the windowsauth module
http://gallery.orchardproject.net/Packages/Orchard.Module.AlexZh.WindowsAuthentication - in the admin settings, I added a user for myself as "my-domain\my-user-name", where the domain name and user are mine.
- added a role to match a AD role that I am a member of and gave this role access to everything.
- switched the iis settings over to use windows auth, and turned off anonymous
- updated the web.config to use windows auth and specify the role that I setup previous

However,I cant get to the admin panel now. What could I be missing?

[ update 2 ] After noticing the documentation link he provided (duh), I saw that I needed to enable windows auth for the modules. So I enabled IIS anonymous again (so I could log in), and updated the settings for the modules, but I see no option under Settings\Users for to enable windows auth. Did it move? Im using v1.10.2


回答1:


You can use the module AlexZh.WindowsAuthentication.

Documentation: http://orchardwinauth.codeplex.com/documentation

First you need to change the Orchard.Web project properties (in Visual Studio, click on project + F4) to ...

Anonymous Authentication: Disabled
Windows Authentication: Enabled

... and then you need to change the Orchard.Web\Web.configto something like this

  <authentication mode="Windows">
    <forms loginUrl="~/Users/Account/AccessDenied" timeout="2880" />
  </authentication>
  <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" />
  <authorization>
    <allow roles="YourDomain\Domain Users" />
    <deny users="?" />
  </authorization>

The permissions can be configured as usual based on Orchard roles.

I've been using this module since 2 years now and i'm pretty happy with it but be aware that the module has several bugs:

  • it might cause a deadlock, see https://github.com/OrchardCMS/Orchard/issues/7688
  • it creates a new user when the logged in domain user cannot be found in the Orchard DB, you might want to alter the class CustomAuthenticationService to avoid this (i can provide some code if you need it)


来源:https://stackoverflow.com/questions/44927245/orchard-cms-with-windows-auth

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