我使用Windows身份验证在企业网络中的Windows Server R2上运行ASP.NET网站.
但是,这不起作用.每次我访问网站时,都会弹出一个询问用户名和密码的对话框.我输入正确的域用户名和密码,但它不会继续 - 窗口再次弹出.三次后,它会失败并显示一个白页.我试过很多不同的浏览器,但都失败了.我让一些同事尝试,他们都失败了.
我无法弄清楚为什么会发生这种错误,并尝试了许多方法来解决它,没有运气.我觉得这很奇怪.然而,最后我找到了解决这个问题的方法,这是问题最奇怪的部分:我在网站的"基本设置"中编辑"物理路径",我只是将它指向另一个健康的网站,例如, %SystemDrive%\ inetpub\wwwroot,然后我尝试浏览网站,非常好,它运行良好并显示默认页面(iisstart.htm).它看起来不是很有帮助,但后来我改变了物理路径回到我的网站; 突然一切顺利 - Windows身份验证工作!我不知道为什么它会有所帮助,但我对这个结果很满意 - 它解决了我的问题,虽然我不知道到底发生了什么.
快乐时间总是很短,几天后,服务器得到一些补丁并重新启动,网站无法再次运行.再次,我可以使用上面的技巧解决问题.
我不喜欢这个!每次IIS重置或服务器重启时,我都不喜欢做这个愚蠢的技巧.
是否有人对Windows身份验证失败的原因有一些想法,为什么上述技巧可以修复它,以及为什么在IIS重置后它再次失败?
我有一个带有Windows身份验证的本地网站(http:// localhost/testsite),效果很好.
现在,我使用Windows身份验证将网站绑定更改为URL(http://testsite.blablabla.biz),从而导致HTTP 401.1 - Unauthorized You do not have permission to view this directory or page using the credentials that you supplied
错误.
我究竟做错了什么?我在谷歌搜索已经很多了,但没有什么真的有用.我认为它与域名或其他东西有关,但我不确定.
我已尝试过这篇文章中的建议,但我无法在Vision Studio 2010中使用IIS身份验证进行Windows身份验证.现在我收到以下错误:
这是我的applicationhost.config文件条目:
...
<add name="WindowsAuthenticationModule" lockItem="false" />
...
<authentication>
<anonymousAuthentication enabled="true" userName="" />
<basicAuthentication enabled="false" />
<clientCertificateMappingAuthentication enabled="false" />
<digestAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="false">
</iisClientCertificateMappingAuthentication>
<windowsAuthentication enabled="true" />
</authentication>
...
<sectionGroup name="authentication">
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<section name="basicAuthentication" overrideModeDefault="Allow" />
<section name="clientCertificateMappingAuthentication" overrideModeDefault="Allow" />
<section name="digestAuthentication" overrideModeDefault="Allow" />
<section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Allow" />
<section name="windowsAuthentication" overrideModeDefault="Allow" />
</sectionGroup>
Run Code Online (Sandbox Code Playgroud)
我的web.config:
<system.web>
<authentication mode="Windows" />
</system.web>
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
这是.NET …
这个问题一直困扰着我......
在本地Intranet环境中,如果我们想要使用模拟我们的Windows域用户,我们注定要在我们的应用程序池中使用"经典"管道模式,或者是否有一种新的方式来声明性地"运行"它们(可以这么说) )?
我的目标是在我的Intranet上对本地Web应用程序使用Windows身份验证,以便用户可以在其活动目录帐户下进行身份验证和运行应用程序(原则).每次我尝试这个(当然使用NetworkService身份),我都会收到此错误:
谢谢!;)
impersonation windows-authentication integrated-pipeline-mode iis-7.5 windows-server-2008-r2
我需要同时具有Windows身份验证和owin(表单)身份验证,但我无法让它工作.
可能最好的选择是让两个站点具有不同的身份验证方法.
我找到了一个能满足我需求的项目:MVC5-MixedAuth.但它使用IISExpress,我无法让它与本地IIS一起使用.
发生的错误是:
在Web服务器上配置请求筛选以拒绝请求,因为查询字符串太长.
如果我删除Startup.Auth.cs中的所有ConfigureAuth()方法,它不会抛出错误,但我无法登录,因为它需要进行CookieAuthentication.
Startup.Auth.cs:
public void ConfigureAuth(IAppBuilder app)
{
app.CreatePerOwinContext(dbEmployeePortal.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, UserMaster, int>
(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentityCallback: (manager, user) => user.GenerateUserIdentityAsync(manager),
getUserIdCallback: (id) => (Int32.Parse(id.GetUserId()))
)
}
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
}
Run Code Online (Sandbox Code Playgroud)
任何的想法?
更新1
错误
在Web服务器上配置请求筛选以拒绝请求,因为查询字符串太长.
出现是因为在尝试访问登录页面时发生登录循环.
我有2个Java Web应用程序需要使用Windows集成身份验证连接到SQL Server数据库.
加载的第一个工作正常,但第二个抛出异常:
Native Library sqljdbc_auth.dll already loaded in another classloader
Run Code Online (Sandbox Code Playgroud)
当我将sqljdbc_auth.dll放在其中一个文件夹中时,会出现上述错误:
如果我将sqljdbc_auth.dll放在下面的一个文件夹中:
两个应用程序抛出异常:
Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path
Run Code Online (Sandbox Code Playgroud)
我正在使用此代码加载驱动程序:
Class.forName("jdbc:sqlserver://<HOST>;databaseName=<DBNAME>;integratedSecurity=true;");
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我试图在Oracle服务器上从MS SQL Server运行openrowset.
当我执行以下命令时:
select * from
OPENROWSET('OraOLEDB.Oracle','srv';'user';'pass',
'select * from table')
Run Code Online (Sandbox Code Playgroud)
发生以下错误
Msg 7302, Level 16, State 1, Line 1
Cannot create an instance of OLE DB provider "OraOLEDB.Oracle" for linked server "(null)".
Run Code Online (Sandbox Code Playgroud)
谁能告诉我如何使用openrowset OraOLEDB.Oracle
?
我使用的是64位版本的MS SQL Server和Oracle OLEDB驱动程序.
我在运行带有MS SQL Server 2008 x64的Windows 7 x64和Windows Server 2008 x64的两台计算机上尝试过此操作.两者都显示相同的错误消息.
sql-server oracle oledb linked-server windows-authentication
如何在ASP.NET MVC4上构建的ServiceStack项目中实现Windows身份验证?
我开始使用添加的全局请求过滤器AppHost
:
private void ConfigureAuth(Funq.Container container)
{
this.RequestFilters.Add((httpReq, httpResp, requestDto) =>
{
var user = HttpContext.Current.User.Identity;
if (!user.IsAuthenticated ||
!user.Name.Contains(_myTestUser)) //todo: check username here in database (custom logic) if it has access to the application
httpResp.ReturnAuthRequired();
});
}
Run Code Online (Sandbox Code Playgroud)
这将打开一个登录对话框,如果输入正确(用户名存在且输入了有效密码,并且myTestUser
设置为此密码),则会产生成功的响应.如果有任何错误,将再次显示登录对话框. - 这对我来说听起来不错.但在第二个登录窗口中重新输入正确的用户后,它将停止工作.该对话框再次打开,如果它再次不正确.过滤器函数内没有遇到断点.
知道是什么原因引起的吗?
这就是我在web.config中添加的内容:
<authentication mode="Windows"/>
<authorization>
<deny users="?" /> <!--only allow authenticated users-->
</authorization>
Run Code Online (Sandbox Code Playgroud)
我想完全锁定网站并仅使用其特定权限(角色)启用对数据库中指定Windows用户的访问.我需要实现自定义逻辑来访问"用户和角色列表".也许在MVC4/ASP.NET中有另一种方法可以做到这一点?
在Windows Server 2008下的IIS7中,我有一个虚拟目录,其中包含匿名访问和Windows身份验证.在我的web.config中,我有:
<authentication mode="Windows"/>
<authorization>
<allow roles="MYGROUP"/>
<deny users="*"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
和
<system.webServer>
<!-- IIS7 security settings -->
<security>
<authorization>
<add accessType="Deny" users="*"/>
<add accessType="Allow" roles="MYGROUP"/>
</authorization>
</security>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
然而,当我从IE访问default.aspx并在Global.asax.vb Application_AuthenticateRequest()中设置断点时,我得到一个空的HttpContext.Current.User,我期待我自己的身份.几乎就像匿名访问一样?
我该怎么做才能解决这个问题?一切似乎都适用于IIS6.
我想将NancyFx用于Intranet Web应用程序.所有文档和论坛仅提及表单和基本身份验证.任何人成功使用Nancy与Windows身份验证?
还有一种名为Nancy.Authentication.Stateless的东西,但我看不出它的作用(看起来像是在Apis中使用).
asp.net ×2
c# ×2
iis ×2
sql-server ×2
.net ×1
.net-4.0 ×1
asp.net-mvc ×1
iis-7 ×1
iis-7.5 ×1
iis-express ×1
java ×1
jdbc ×1
nancy ×1
oledb ×1
oracle ×1
owin ×1
servicestack ×1
tomcat ×1