Я внедряю SAML 2.0 с использованием библиотеки AspNetSaml и JumpCloud в качестве IDP в приложении ASP. NET Web Forms. Ниже приведены метаданные моего поставщика услуг, которые я настроил в 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>
Запрос SAML инициируется с помощью кнопки «Вход» на странице по умолчанию в моем приложении ASP. NET Web Forms.
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 пуст.
![enter image description here](https://i.stack.imgur.com/JwbZT.png)
Это делает объект Request.Form ["SAMLResponse"] как нулевой.
Может кто-нибудь, пожалуйста, дать некоторые указания на то, что я делаю неправильно? Спасибо!