Azure AD B2C WS-Federation and SAML claims provider, unable to read name identifier -


ad fs configured custom policies claims provider on azure ad b2c using ws-federation , saml. relying party on azure ad b2c using openid connect.

when receiving saml token, azure ad b2c unable read name identifier, other claims types given name surname, email or upn read without problems.

how custom policies configured in azure ad b2c read name identifier?

in saml token name identifier placed in subject other claims placed in attributes.

here saml token example:

<t:requestsecuritytokenresponse xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">   <t:lifetime>     <wsu:created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-07-21t06:26:09.625z</wsu:created>     <wsu:expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-07-21t07:26:09.625z</wsu:expires>   </t:lifetime>   <wsp:appliesto xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">     <wsa:endpointreference xmlns:wsa="http://www.w3.org/2005/08/addressing">       <wsa:address>https://login.microsoftonline.com/te/xxxx.onmicrosoft.com/b2c_1a_trustframeworkbase</wsa:address>     </wsa:endpointreference>   </wsp:appliesto>   <t:requestedsecuritytoken>     <saml:assertion majorversion="1" minorversion="1" assertionid="_51bc4bdd-515f-4860-8281-760acdd31813" issuer="http://adfs-dev.local/adfs/services/trust" issueinstant="2017-07-21t06:26:09.625z" xmlns:saml="urn:oasis:names:tc:saml:1.0:assertion">       <saml:conditions notbefore="2017-07-21t06:26:09.625z" notonorafter="2017-07-21t07:26:09.625z">         <saml:audiencerestrictioncondition>           <saml:audience>https://login.microsoftonline.com/te/xxxx.onmicrosoft.com/b2c_1a_trustframeworkbase</saml:audience>         </saml:audiencerestrictioncondition>       </saml:conditions>       <saml:attributestatement>         <saml:subject>           <saml:nameidentifier format="urn:oasis:names:tc:saml:2.0:nameid-format:persistent">test1@adfsdev.local</saml:nameidentifier>           <saml:subjectconfirmation>             <saml:confirmationmethod>urn:oasis:names:tc:saml:1.0:cm:bearer</saml:confirmationmethod>           </saml:subjectconfirmation>         </saml:subject>         <saml:attribute attributename="givenname" attributenamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">           <saml:attributevalue>test1</saml:attributevalue>         </saml:attribute>         <saml:attribute attributename="surname" attributenamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">           <saml:attributevalue>test user</saml:attributevalue>         </saml:attribute>         <saml:attribute attributename="emailaddress" attributenamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">           <saml:attributevalue>test1mail@adfsdev.local</saml:attributevalue>         </saml:attribute>         <saml:attribute attributename="upn" attributenamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">           <saml:attributevalue>test1@adfsdev.local</saml:attributevalue>         </saml:attribute>       </saml:attributestatement>       <saml:authenticationstatement authenticationmethod="urn:oasis:names:tc:saml:2.0:ac:classes:passwordprotectedtransport" authenticationinstant="2017-07-21t06:26:09.546z">         <saml:subject>           <saml:nameidentifier format="urn:oasis:names:tc:saml:2.0:nameid-format:persistent">test1@adfsdev.local</saml:nameidentifier>           <saml:subjectconfirmation>             <saml:confirmationmethod>urn:oasis:names:tc:saml:1.0:cm:bearer</saml:confirmationmethod>           </saml:subjectconfirmation>         </saml:subject>       </saml:authenticationstatement>       <ds:signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">         <ds:signedinfo>           <ds:canonicalizationmethod algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />           <ds:signaturemethod algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />           <ds:reference uri="#_51bc4bdd-515f-4860-8281-760acdd31813">             <ds:transforms>               <ds:transform algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />               <ds:transform algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />             </ds:transforms>             <ds:digestmethod algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />             <ds:digestvalue>gaumc47gymi+4o9ff2blavd9p0jkurevep4rw+wn2ho=</ds:digestvalue>           </ds:reference>         </ds:signedinfo>         <ds:signaturevalue>xqkkxmwcycj8v3u ... 9h9anliv/xqx9bg==</ds:signaturevalue>         <keyinfo xmlns="http://www.w3.org/2000/09/xmldsig#">           <x509data>             <x509certificate>miic+jccaekgawiba ... dht3oknufxsq==</x509certificate>           </x509data>         </keyinfo>       </ds:signature>     </saml:assertion>   </t:requestedsecuritytoken>   <t:tokentype>urn:oasis:names:tc:saml:1.0:assertion</t:tokentype>   <t:requesttype>http://schemas.xmlsoap.org/ws/2005/02/trust/issue</t:requesttype>   <t:keytype>http://schemas.xmlsoap.org/ws/2005/05/identity/noproofkey</t:keytype> </t:requestsecuritytokenresponse> 


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -