ActiveDirectoryMembershipProvider 不接受 FQDN

发布于 2024-09-12 07:06:12 字数 320 浏览 7 评论 0原文

我们正在尝试为 ASP.NET Intranet 应用程序设置 ActiveDirectoryMemebershipProvider,该应用程序应该在浏览器中访问该应用程序时自动将用户登录到该应用程序中。

但是,浏览器正在将 FQDN (MYDOMAIN\some.user) 发送到服务器,并且 ActiveDirectoryMemebershipProvider 似乎无法根据 FQDN 找到用户。然而,当我们通过代码手动测试提供程序时,我们发现如果我们仅尝试用户名(some.user),提供程序似乎能够找到用户。

是否有任何设置或任何东西我们可以使用来使提供商跳过从浏览器发送的域部分?

We are trying to set up the ActiveDirectoryMemebershipProvider for an ASP.NET intranet application that is supposed to automatically sign the users into the application when it is accessed in the browser.

However the browser is sending the FQDN (MYDOMAIN\some.user) to the server and the ActiveDirectoryMemebershipProvider seems not to be able to be able to find the user based on the FQDN. However when we test the provider manually from code we found that if we try just the user name (some.user) the provider seems to be able to find the user.

Is there any setting or anything we can use to make the provider skip the domain part sent from the browser ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

会发光的星星闪亮亮i 2024-09-19 07:06:12

如果您还没有尝试设置 atttributeMapUsername,请告诉我这是否适合您。当我没有设置这个时,我必须在 [email protected] 中指定我的用户] 格式。

我的Web.config

    <add name="MyADMembershipProvider"
         type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ADConnectionString"
         attributeMapUsername="sAMAccountName"
         enablePasswordReset="false" maxInvalidPasswordAttempts="1" passwordAttemptWindow="15" 
         passwordAnswerAttemptLockoutDuration="1" minRequiredNonalphanumericCharacters="0" attributeMapEmail="mail"
         />

Try setting atttributeMapUsername if you haven't and let me know if that works for you. When I didn't set this I had to specify my users in [email protected] format.

My Web.config

    <add name="MyADMembershipProvider"
         type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ADConnectionString"
         attributeMapUsername="sAMAccountName"
         enablePasswordReset="false" maxInvalidPasswordAttempts="1" passwordAttemptWindow="15" 
         passwordAnswerAttemptLockoutDuration="1" minRequiredNonalphanumericCharacters="0" attributeMapEmail="mail"
         />
内心旳酸楚 2024-09-19 07:06:12

在 IIS 中,转到网站的属性并将默认域设置为“\”。不确定您使用的是哪个版本的 IIS,因此如果 IIS 对此进行了重置,实现此目的的另一种方法是简单地在前面添加域部分,以便自动添加它?

这是您正在使用的自定义应用程序还是产品?试图理解为什么它可以从代码中运行,但不能从应用程序中运行。如果您编写了该应用程序,我认为您可以更改它以模仿您的代码。如果应用程序不是您编写的,那它是什么?应用程序(例如 OWA 或 SharePoint)可能有一个自定义方式来完成此操作。

In IIS, go to the properties of the website and set the default domain to "\". Not sure which version of IIS you are using so if IIS resets this on you, the other way to accomplish this is to simply prepend the domain part so that it is added automatically?

Is this a custom app you are using or a product? Trying to understand why it is working from code but not from app. If you wrote the app, I assume you can change it to mimic your code. If you did not write the app, what is it? The app (such as OWA or SharePoint) may have a custom way it wants this done.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文