Получение ошибки при реализации единого входа в нашем веб-приложении с использованием ADFS и SAML2.0 (Sustainsys)
Я пытаюсь реализовать SSO в нашем веб-приложении, используя ADFS и SAML2.0. Я использую Windows Server 2012 r2 в качестве среды adfs. веб-приложение также находится в той же среде.
Пока я запускаю приложение, меня перенаправляют на главную страницу входа, где я могу выбрать вход в систему с помощью sso. после выбора опции sso меня перенаправляют на экран входа в систему adfs, и когда я пытаюсь войти в систему с надлежащими учетными данными, я получаю следующую ошибку:
Обнаружена ошибка во время пассивного запроса федерации. Имя протокола дополнительных данных: проверяющая сторона Saml: https://ADFSDomain/adfs/ls/ Сведения об исключении: Microsoft.IdentityServer.Service.Policy.PolicyServer.Engine.MissingAssertionConsumerServicesPolicyException: MSIS3077: свойство AssertionConsumerServices не является получателем запроса на получение услуг.: // ADFSDomain / ADFS / лс /". в Microsoft.IdentityServer.Service.SamlProtocol.EndpointResolver.LookupAssertionConsumerServiceByUrl(Collection`1 assertionConsumerServices Ури requestedAssertionConsumerServiceUrl, Строка scopeIdentity) в Microsoft.IdentityServer.Service.SamlProtocol.EndpointResolver.FindSamlResponseEndpointForAuthenticationRequest(Boolean artifactEnabled, запрос AuthenticationRequest, ScopeDescription scopeDescription) в Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolManager.GetResponseEndpointFromRequest(SamlRequest запрос, булева isUrlTranslationNeeded, ScopeDescription сфера) в Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolManager.Issue(HttpSamlRequestMessage httpSamlRequestMessage, SecurityTokenElement onBehalfOf, String sessionState, String RelayState, String & newSamlSession, String & samlpAuthenticationProvider, Boolean isUrlTranslationNeeded, WrappedHttpListenerContext context, Boolean isKmsiRequested) в Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.RequestBearerToken(WrappedHttpListenerContext контекст, HttpSamlRequestMessage httpSamlRequest, SecurityTokenElement onBehalfOf, String relyingPartyIdentifier, булева isKmsiRequested, булева isApplicationProxyTokenRequired, String& samlpSessionState, String& samlpAuthenticationProvider) при Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.BuildSignInResponseCoreWithSerializedToken(HttpSamlRequestMessage httpSamlRequest, WrappedHttpListenerContext контекст, String relyingPartyIdentifier, SecurityTokenElement signOnTokenElement, булева isKmsiRequested, булева isApplicationProxyTokenRequired) при Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.BuildSignInResponseCoreWithSecurityToken(SamlSignInContext контекст, SecurityToken SecurityToken, SecurityToken deviceSecurityToken) при Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.Process(ProtocolContext контекст) в Microsoft.IdentityServer.Web.PassiveProtocolListener.ProcessProtocolRequest(протокол Context protocolContext, PassiveProtocolHandler protocolHandler) в Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(контекст WrappedHttpListenerContext)
Вот так выглядит web.config:
<sustainsys.saml2 modulePath="/AuthServices" entityId="https://ADFSDomain/adfs/ls/" returnUrl="http://localhost:2181/">
<identityProviders>
<add entityId="http://ADFSDomain/adfs/services/trust"
signOnUrl="https://ADFSDomain/adfs/ls/"
allowUnsolicitedAuthnResponse="true"
binding="HttpRedirect"
wantAuthnRequestsSigned="false"
loadMetadata="true"
metadataLocation="https://ADFSDomain/federationmetadata/2007-06/federationmetadata.xml">
<signingCertificate fileName="~/App_Data/newCert.cer" />
</add>
</identityProviders>
</sustainsys.saml2>
1 ответ
entityId
в вашей конфигурации должен использоваться путь, специфичный для вашего приложения поставщика услуг, а не ADFS (поставщик удостоверений).
Пример конфигурации:
<?xml version="1.0"?>
<sustainsys.saml2 entityId="https://yourdomain.com/apppath/Saml2" returnUrl="https://yourapp.com/apppath/" authenticateRequestSigningBehavior="Always" outboundSigningAlgorithm="SHA256">
<identityProviders>
<add entityId="http://adfs.yourdomain.com/adfs/services/trust" signOnUrl="https://adfs.yourdomain.com/adfs/ls" logoutUrl="https://adfs.yourdomain.com/adfs/ls" allowUnsolicitedAuthnResponse="true" binding="HttpRedirect" loadMetadata="true" metadataLocation="https://adfs.yourdomain.com/federationmetadata/2007-06/federationmetadata.xml" />
</identityProviders>
<serviceCertificates>
<add storeName="My" storeLocation="LocalMachine" findValue="xxx" x509FindType="FindByThumbprint" />
</serviceCertificates>
</sustainsys.saml2>