title: ADFS 3.0 Error Event ID 511 and 364 when using Web Application Proxy
body: <p>We are trying to set up our Development environment and we are facing issue's when WAP comes in play with ADFS. Below is what we have so far.</p>
  
  <p>Our ADFS Server is tied to Active Directory and is working fine with one of the Claims aware relying party we have.</p>
  
  <p>But when we installed the Web Application Proxy for this ADFS server and published this Claims aware RP in the WAP the ADFS Challenge is no longer working. Below is the flow </p>
  
  <ol>
  <li>I'm to reach the External Url of this published app</li>
  <li>User is getting re-directed to the ADFS Challenge screen with Error on it.</li>
  </ol>
  
  <p>When I went to the ADFS 3.0 event viewer, I see two errors with Event ID 511, 364.</p>
  
  <p><strong>Few things to note-</strong>
  I'm using a certificate issued by our Internal CA for ADFS Server.
  The published application in the WAP is using a certificate issued by our Internal CA. Does this certificate of this published app must be issued issued by public CA even though this is a dev. environment setup ?</p>
  
  <p><strong>Error with Event ID 511-</strong></p>
  
  <p>The incoming sign-in request is not allowed due to an invalid Federation Service configuration.  </p>
  
  <p>Request url: 
   /adfs/ls?version=1.0&amp;action=signin&amp;realm=urn'%'3AAppProxy'%'3Acom&amp;appRealm= masked it on purpose&amp;returnUrl=masked it on purpose&amp;client-request-id= masked it on purpose</p>
  
  <p>User Action:
   Examine the Federation Service configuration and take the following actions: 
    Verify that the sign-in request has all the required parameters and is formatted correctly. 
    Verify that a web application proxy relying party trust exists, is enabled, and has identifiers which match the sign-in request parameters. 
    Verify that the target relying party trust object exists, is published through the web application proxy, and has identifiers which match the sign-in request parameters.</p>
  
  <p><strong>Error with Event ID 364-</strong></p>
  
  <p>Encountered error during federation passive request. </p>
  
  <p>Additional Data </p>
  
  <p>Protocol Name: </p>
  
  <p>Relying Party: </p>
  
  <p>Exception details: 
  Microsoft.IdentityServer.Web.InvalidRequestException: MSIS7009: The request was malformed or not valid. Contact your administrator for details.
     at Microsoft.IdentityServer.Web.Protocols.MSISHttp.MSISHttpProtocolHandler.ValidateSignInContext(MSISHttpSignInRequestContext msisContext, WrappedHttpListenerRequest request)
     at Microsoft.IdentityServer.Web.Protocols.MSISHttp.MSISHttpProtocolHandler.CreateProtocolContext(WrappedHttpListenerRequest request)
     at Microsoft.IdentityServer.Web.PassiveProtocolListener.GetProtocolHandler(WrappedHttpListenerRequest request, ProtocolContext&amp; protocolContext, PassiveProtocolHandler&amp; protocolHandler)
     at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)</p>
  
  <p>Any help would be greatly appreciated!!! Please let me know if you need more information.</p>