我将WSO2服务器用作服务提供者,我没有任何问题地检索索赔数据,但是我无法从XML SAML响应中检索“ samlp:Extensions”标签数据。
XML示例:
<samlp:Response Destination="{WSO2_host}/commonauth"
ID="s2c4b934af24d627198f9eff" InResponseTo="_2feee99ff6d22f"
IssueInstant="2018-09-02T09:04:02Z" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">{identity_provider_host}:443/secure</saml:Issuer>
<samlp:Extensions xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<lang:LanguageInfo LangCode="en" xmlns:lang="urn:lang"/>
</samlp:Extensions>
<samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"></samlp:StatusCode>
</samlp:Status>
<saml:Assertion ID="s21addcf3a881eb22c9de1ffddf911c" IssueInstant="2018-09-02T09:04:02Z"
Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<saml:Issuer>{identity_provider_host}:443/secure</saml:Issuer>
<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/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#s21addcf3a881eb22c9de1ffddf911c42">
<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/2000/09/xmldsig#sha1"/>
<ds:DigestValue>GBCHtndrrgi2xQAH=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>{SignatureValue}</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>{Certificate}</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
NameQualifier="{identity_provider_host}:443/secure">4B9X2ek56r488phHoJhmzk65/r/b</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData InResponseTo="_2feee99ff6d22f7e64a1a937b3ff440a"
NotOnOrAfter="2018-09-02T09:14:02Z" Recipient="{WSO2_host}/commonauth"/></saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2018-09-02T08:54:02Z" NotOnOrAfter="2018-09-02T09:14:02Z">
<saml:AudienceRestriction>
<saml:Audience>{client_web_site}</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2018-09-02T09:04:02Z"
SessionIndex="s2f39c413f6a204071cbd8d7300a897d7926310501">
<saml:AuthnContext>
<saml:AuthnContextClassRef>urn:ae:gov:tra:nias:usernamepassword</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
<saml:Attribute Name="urn:ae:gov:tra:nias:firstnameEN">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Abraaar</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:mobileNotVerified">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">9627881236</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:lastnameEN">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Hijazi</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:nationalityEN">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">JOR</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:firstnameAR">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string"></saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:lastnameAR">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string"></saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:gender">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Female</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:adsicUserName">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">tara_tareq</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:userType">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SOP1</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:email">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">qa.swat@bayt.net</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:uuid">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">0fa5f906-84a8-4fa2-8597</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:ae:gov:tra:nias:dob">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">01/01/1990</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
</samlp:Response>
我可以得到以下索赔数据:
<saml:Attribute Name="urn:ae:gov:tra:nias:dob">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">01/01/1990</saml:AttributeValue>
</saml:Attribute>
但是我无法获得像(LangCode =“ en”)这样的“ samlp:Extensions”标签数据:
<samlp:Extensions xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<lang:LanguageInfo LangCode="en" xmlns:lang="urn:lang"/>
</samlp:Extensions>
是否有任何方法可以在服务提供者端获取此类数据,例如将带有回调URL的数据附加为查询字符串参数或将其与请求的索赔数据一起返回?
WSO2版本:5.6.0