AD FS email claim not found
<p>I have a web app. I'm trying to get it to authenticate against a Win2012 R2 ADFS server.</p>

<p>I have the relying party set up, get redirected, sign in, then redirected back to the app as a failed request.</p>

<p>In the event log I have this:</p>

<blockquote>
  <p>MSIS7070: The SAML request contained a NameIDPolicy that was not satisfied by the issued token. Requested NameIDPolicy: AllowCreate: True Format: urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress SPNameQualifier: . Actual NameID properties: null.</p>
</blockquote>

<p>If I read this right, the webapp is asking for <code>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</code> but that policy isn't found for the relying party.</p>

<p>Under the relying party, I have two rules:</p>

<pre><code># get email address from active directory
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
 =&gt; issue(store = "Active Directory", 
types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"), query = ";mail;{0}", param = c.Value);
</code></pre>

<p>rule 2</p>

<pre><code>transform email address to nameid/email
c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
 =&gt; issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", 
Issuer = c.Issuer, 
OriginalIssuer = c.OriginalIssuer, 
Value = c.Value, 
ValueType = c.ValueType, 
Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"]
 = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
</code></pre>

<p>I've double checked and made sure that the formats match, but I'm stuck on the error messages.</p>