我正在ASP.NET Web窗体应用程序中使用AspNetSaml库和JumpCloud作为IDP实施SAML 2.0。以下是我在JumpCloud中配置的服务提供商元数据:
<?xml version="1.0"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
validUntil="2020-04-25T04:40:01Z"
cacheDuration="PT604800S"
entityID="SPEntityID1234567892">
<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://localhost:44338/SSOLogin.aspx"
index="1" />
</md:SPSSODescriptor>
</md:EntityDescriptor>
正在从我的ASP.NET Web窗体应用程序的“默认”页面上的“登录”按钮发起SAML请求。
var samlEndpoint = "<jumpcloud saml app end point>";
var request = new AuthRequest(
"SPEntityID1234567892", //TODO: put your app's "unique ID" here
"https://localhost:44338/SSOLogin.aspx" //TODO: put Assertion Consumer URL (where the provider should redirect users after authenticating)
);
//redirect the user to the SAML provider
Response.Redirect(request.GetRedirectUrl(samlEndpoint));
发起SAML请求后,我将重定向到IDP,并要求进行身份验证。但是在身份验证之后,当我重定向回我的应用程序(https://localhost:44338/SSOLogin.aspx)时,Forms对象为空。
这使Request.Form [“ SAMLResponse”]对象为空。
有人可以提供一些关于我做错了什么的指示吗?谢谢!