首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >接收来自SAML2响应的HTTP400错误请求

接收来自SAML2响应的HTTP400错误请求
EN

Stack Overflow用户
提问于 2022-03-29 21:47:07
回答 1查看 891关注 0票数 1

我有一个运行IIS web服务器的Windows 2019。我的组织使用ADFS 2016,一个团队代表我在ADFS中配置了IdP集成。所有内容(帐户、服务器等)都是AD域网络的一部分(都在相同的域基础结构中)。

我正在构建一个.NET 6应用程序,并使用这个示例将其部署到服务器上,该示例使用itfoxtec-identity-saml2 2:如何在ASP.NET内核和C#中使用SAML进行身份验证

这个应用程序很好的启动。当我单击登录按钮时,当我重定向回应用程序时会出现一个错误:"HTTP 400“。

浏览器控制台:x加载资源失败:服务器响应为400 () chromewebdata://chromewebdata/:1 crbug/1173575,不推荐使用非JS模块文件。(匿名)@VM9 9:2762

来自开发人员控制台的头数据:

请求网址:/ADFSTest

请求方法: POST

地位法: 400

远程地址: 10.137.0.7:443

转介政策:严格的原产时交叉来源

日期:2022年3月29日星期二21:02:57格林尼治标准时间

服务器: Microsoft-IIS/10.0

严格的传输安全性:最大年龄=0;includeSubDomains

*授权: oitctxwbdcsp1.deleted 1.删除

*方法:员额

:path: /ADFSTest :path: https

接受

text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed;v=b3;q=0.9

接受-编码: gzip,deflate,br

接受语言: en-US,en;q=0.9

缓存控制:无缓存

内容长度: 3813

内容类型: application/x-www-form-urlencoded

产地:https://dev.adfs.federation.

pragma:无缓存

推荐者:/

sec-ch-ua:“Not A;品牌”“;v=”99,"Chromium";v="98","Microsoft Edge“;v=98”

sec-ch-ua-移动电话:0

sec-ch-ua-平台:"Windows“

证券交易委员会-索取-最:文件

sec-获取模式:导航

sec-获取-站点:同一站点

升级-不安全-请求:1

用户代理: Mozilla/5.0 (WindowsNT10.0;Win64;x64) AppleWebKit/537.36

Chrome/98.0.4758.119 Safari/537.36 Edg/98.0.1108.76

SAML响应(解码)

代码语言:javascript
复制
<samlp:Response ID="_df09235a-cd8e-40bf-a5b4-03aa6c1bf55e" Version="2.0" IssueInstant="2022-03-29T21:02:57.580Z" Destination="https://oitctxwbdcsp1.*deleted*/ADFSTest" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" InResponseTo="_ca71b9ef-4bf8-45b3-930c-a7bbe58a0dc0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"><Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">http://dev.adfs.federation.*deleted*/adfs/services/trust</Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /><ds:Reference URI="#_df09235a-cd8e-40bf-a5b4-03aa6c1bf55e"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /><ds:DigestValue>3Z+f+F61txOvBDBdtd2TXlt51Gs8mxXgtBJQu4zVXfE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>X2hy*deleted*</ds:SignatureValue><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><ds:X509Data><ds:X509Certificate>MIIC8*deleted*</ds:X509Certificate></ds:X509Data></KeyInfo></ds:Signature><samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Responder" /></samlp:Status></samlp:Response>

RelayState: 删除/ADFSTest/=%2F

附加信息: ADFS IdP从我提供的URL中读取元数据。元数据如下所示:

代码语言:javascript
复制
<?xml version="1.0"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
                     validUntil="2032-03-12T19:19:05Z"
                     cacheDuration="PT604800S"
                     entityID="https://oitctxwbdcsp1.*deleted*">
    <md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
        <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
        <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://oitctxwbdcsp1.*deleted*/ADFSTest" index="0" />
    </md:SPSSODescriptor>
</md:EntityDescriptor>

appsettings.json如下所示:

代码语言:javascript
复制
{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "Saml2": {
    "IdPMetadata": "https://dev.adfs.federation.*deleted*/federationmetadata/2007-06/federationmetadata.xml",
    "Issuer": "https://oitctxwbdcsp1.*deleted*",
    "SignatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
    "CertificateValidationMode": "ChainTrust",
    "RevocationMode": "NoCheck"
  },
  "AllowedHosts": "*"
}

一般来说,我对SAML2和身份验证都很陌生。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-30 09:39:25

您正在从AD获得SAML响应中的一个错误。错误状态为urn:oasis:names:tc:SAML:2.0:status:Responder

AD上出现了一个错误,停止了登录序列。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71669144

复制
相关文章

相似问题

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