首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ID1059:无法对用户进行身份验证,因为URL方案不是https,requireSsl设置为true。

ID1059:无法对用户进行身份验证,因为URL方案不是https,requireSsl设置为true。
EN

Stack Overflow用户
提问于 2014-01-07 19:48:03
回答 3查看 12.4K关注 0票数 7

我们有一个网站托管和配置使用ADFS2.0进行SSO。当我通过https浏览网站时,我会得到以下错误。

我认为原因是负载均衡器正在用http访问web服务器。如果我在web.config中更改下面的条目,它可能会修复,但不确定副作用。在这方面有经验吗?

代码语言:javascript
复制
 <federatedAuthentication>
    <wsFederation passiveRedirectEnabled="true" 
            issuer="https://localhost/abc" 
            realm="https://localhost/abc/" requireHttps="true"/>
    <cookieHandler requireSsl="true"/>
</federatedAuthentication> 

异常详细信息: System.InvalidOperationException: ID1059:无法对用户进行身份验证,因为URL方案不是https,并且在配置中requireSsl设置为true,因此不会发送身份验证cookie。将URL方案更改为https,或在配置中的requireSsl元素上将cookieHandler设置为false。 System.IdentityModel.Services.WSFederationAuthenticationModule.OnEndRequest(Object发件人,EventArgs args) +726

EN

回答 3

Stack Overflow用户

发布于 2014-01-07 22:58:21

当您安装终止SSL的负载平衡器时,这是一个典型的错误。

我们有很多这样的网站--从来没有发现任何副作用。

只需确保ADFS流量发出,然后进入,因为ADFS在配置时不允许http端点。当重定向回RP时,它总是使用https端点。

警告词- ADFS流量不能在负载均衡器上终止-它需要https一直到ADFS服务器。

票数 2
EN

Stack Overflow用户

发布于 2014-04-13 15:31:16

我通过将SSL Enabled的web项目设置更改为true来解决开发中的这个错误。它以某种方式被设置为false,并且也没有设置SSL URL属性值。

票数 2
EN

Stack Overflow用户

发布于 2018-06-07 09:33:27

我们遇到了同样的问题。我认为WSFederationAuthenticationModule.OnEndRequest.在cookieHandler中的标志requireSsl是由System.IdentityModel.Services.ChunkedCookieHandler设置抽象类System.IdentityModel.Services.CookieHandler,并在cookies上设置安全标志。如果此标志设置为true,则为客户端(browser p.a.)只负责通过安全连接(https)发送cookie。但是在WSFederationAuthenticationModule.OnEndRequest中,如果Request.Url不是https请求,则使用标志来取消进程。这是SSL卸载方案中错误的行为。一种解决方案是实现自定义WsFederationAuthenticationModule并覆盖OnEndRequest:

代码语言:javascript
复制
     protected override void OnEndRequest(object sender, EventArgs args)
    {
        var reqSsl = FederatedAuthentication.SessionAuthenticationModule.CookieHandler.RequireSsl;
        //System.IdentityModel.Services.ChunkedCookieHandler
        if (reqSsl)
        {
            FederatedAuthentication.SessionAuthenticationModule.CookieHandler.RequireSsl = false;
            try
            {
                base.OnEndRequest(sender, args);
            }
            finally
            {
                FederatedAuthentication.SessionAuthenticationModule.CookieHandler.RequireSsl = reqSsl;
            }
        }
        else
            base.OnEndRequest(sender, args);
    }
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20980431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档