title: Getting an error while implementing SSO in our web application using ADFS and SAML2.0 (Sustainsys)
body: <p>Im Trying to implement SSO in our web application using ADFS and SAML2.0. I am using Windows Server 2012 r2 as my adfs environment. the web application is also in the same environment.</p>
  
  <p>So far when i run the application, I get directed to the main sign in page where i can choose to login using sso. after clicking the sso option, i get redirected to the adfs signon screen and when i try to login with the proper credentials, I get the following error: </p>
  
  <pre>
  Encountered error during federation passive request. 
  
  Additional Data 
  
  Protocol Name: 
  Saml 
  
  Relying Party: 
  https://ADFSDomain/adfs/ls/ 
  
  Exception details: 
  Microsoft.IdentityServer.Service.Policy.PolicyServer.Engine.MissingAssertionConsumerServicesPolicyException: MSIS3077: The AssertionConsumerServices property is not configured for relying party trust 'https://ADFSDomain/adfs/ls/'.
     at Microsoft.IdentityServer.Service.SamlProtocol.EndpointResolver.LookupAssertionConsumerServiceByUrl(Collection`1 assertionConsumerServices, Uri requestedAssertionConsumerServiceUrl, String scopeIdentity)
     at Microsoft.IdentityServer.Service.SamlProtocol.EndpointResolver.FindSamlResponseEndpointForAuthenticationRequest(Boolean artifactEnabled, AuthenticationRequest request, ScopeDescription scopeDescription)
     at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolManager.GetResponseEndpointFromRequest(SamlRequest request, Boolean isUrlTranslationNeeded, ScopeDescription scope)
     at 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)
     at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.RequestBearerToken(WrappedHttpListenerContext context, HttpSamlRequestMessage httpSamlRequest, SecurityTokenElement onBehalfOf, String relyingPartyIdentifier, Boolean isKmsiRequested, Boolean isApplicationProxyTokenRequired, String& samlpSessionState, String& samlpAuthenticationProvider)
     at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.BuildSignInResponseCoreWithSerializedToken(HttpSamlRequestMessage httpSamlRequest, WrappedHttpListenerContext context, String relyingPartyIdentifier, SecurityTokenElement signOnTokenElement, Boolean isKmsiRequested, Boolean isApplicationProxyTokenRequired)
     at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.BuildSignInResponseCoreWithSecurityToken(SamlSignInContext context, SecurityToken securityToken, SecurityToken deviceSecurityToken)
     at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.Process(ProtocolContext context)
     at Microsoft.IdentityServer.Web.PassiveProtocolListener.ProcessProtocolRequest(ProtocolContext protocolContext, PassiveProtocolHandler protocolHandler)
     at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)
  </pre>
  
  <p>This is how the web.config looks like:</p>
  
  <pre><code>&lt;sustainsys.saml2 modulePath="/AuthServices" entityId="https://ADFSDomain/adfs/ls/" returnUrl="http://localhost:2181/"&gt;
      &lt;identityProviders&gt;
        &lt;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"&gt;
          &lt;signingCertificate fileName="~/App_Data/newCert.cer" /&gt;
        &lt;/add&gt;
      &lt;/identityProviders&gt;
    &lt;/sustainsys.saml2&gt;
  </code></pre>