<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="font-family: ArialMT;" class="">Hi All, </span><div class="" style="font-family: ArialMT;"><br class=""></div><div class="" style="font-family: ArialMT;">Sorry in advance for the probably stupid question. </div><div class="" style="font-family: ArialMT;"><br class=""></div><div class="" style="font-family: ArialMT;">I’m creating a SPSSODescriptor, and I want to add two RequestedAttribtues, like in the example of SAML-METADATA. </div><div class="" style="font-family: ArialMT;"><br class=""></div><div class="" style="font-family: ArialMT;"><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;"><RequestedAttribute</div><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;">NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</div><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;">Name="urn:oid:1.3.6.1.4.1.5923.1.1.1.7"</div><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;">FriendlyName="eduPersonEntitlement"></div><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;"><saml:AttributeValue></div><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;"><a href="https://ServiceProvider.com/entitlements/123456789" class="">https://ServiceProvider.com/entitlements/123456789</a></div><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;"></saml:AttributeValue></div><div class="" style="margin: 0px; font-size: 9px; line-height: normal; font-family: Helvetica;"></RequestedAttribute></div><div class=""><br class="webkit-block-placeholder"></div><div class="">I am using this code (buildSAMLObject is from the Book). I see (in the last for loop) the values in there, : </div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;">List<RequestedAttribute> <span class="" style="color: rgb(126, 80, 79);">raq</span> = <span class="" style="color: rgb(126, 80, 79);">x</span>.getRequestedAttributes().stream().map(<span class="" style="color: rgb(126, 80, 79);">z</span> -> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> RequestedAttribute <span class="" style="color: rgb(126, 80, 79);">ra</span>;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">try</span> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">ra</span> = OpenSAML330LHelper.buildSAMLObject(RequestedAttribute.<span class="" style="color: rgb(147, 26, 104);">class</span>);</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">ra</span>.setName(<span class="" style="color: rgb(126, 80, 79);">z</span>.getName());</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">ra</span>.setNameFormat(<span class="" style="color: rgb(126, 80, 79);">z</span>.getNameFormat());</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">ra</span>.setFriendlyName(<span class="" style="color: rgb(126, 80, 79);">z</span>.getFriendlyName());</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">ra</span>.setIsRequired(<span class="" style="color: rgb(126, 80, 79);">z</span>.isRequired());</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> List<AttributeValue> <span class="" style="color: rgb(126, 80, 79);">attrVal</span> = <span class="" style="color: rgb(126, 80, 79);">z</span>.getAttributeValues();</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">if</span> (<span class="" style="color: rgb(126, 80, 79);">attrVal</span> != <span class="" style="color: rgb(147, 26, 104);">null</span>) {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> List<XSString> <span class="" style="color: rgb(126, 80, 79);">back</span> = <span class="" style="color: rgb(126, 80, 79);">attrVal</span>.stream().map(<span class="" style="color: rgb(126, 80, 79);">y</span> -> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">try</span> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> XSStringBuilder <span class="" style="color: rgb(126, 80, 79);">stringBuilder</span> = (XSStringBuilder) XMLObjectProviderRegistrySupport.getBuilderFactory()</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> .getBuilder(XSString.<span class="" style="color: rgb(3, 38, 204);">TYPE_NAME</span>);</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> XSString <span class="" style="color: rgb(126, 80, 79);">stringVal</span> = <span class="" style="color: rgb(126, 80, 79);">stringBuilder</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> .buildObject(org.opensaml.saml.saml2.core.AttributeValue.<span class="" style="color: rgb(3, 38, 204);">DEFAULT_ELEMENT_NAME</span>, XSString.<span class="" style="color: rgb(3, 38, 204);">TYPE_NAME</span>);</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">stringVal</span>.setValue(<span class="" style="color: rgb(126, 80, 79);">y</span>.getAttributeValue());</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">return</span> <span class="" style="color: rgb(126, 80, 79);">stringVal</span>;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> } <span class="" style="color: rgb(147, 26, 104);">catch</span> (Exception <span class="" style="color: rgb(126, 80, 79);">e</span>) {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">throw</span> <span class="" style="color: rgb(147, 26, 104);">new</span> IllegalStateException(<span class="" style="color: rgb(126, 80, 79);">e</span>);</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> }).collect(Collectors.toList());</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">ra</span>.getAttributeValues().addAll(<span class="" style="color: rgb(126, 80, 79);">back</span>);</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">return</span> <span class="" style="color: rgb(126, 80, 79);">ra</span>;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> } <span class="" style="color: rgb(147, 26, 104);">catch</span> (OpenSAMLUtilitiesError <span class="" style="color: rgb(126, 80, 79);">e</span>) {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">throw</span> <span class="" style="color: rgb(147, 26, 104);">new</span> IllegalStateException(<span class="" style="color: rgb(126, 80, 79);">e</span>);</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> }).collect(Collectors.toList());</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(147, 26, 104);">for</span> (<span class="" style="color: rgb(147, 26, 104);">int</span> <span class="" style="color: rgb(126, 80, 79);">i</span> = 0; <span class="" style="color: rgb(126, 80, 79);">i</span> < <span class="" style="color: rgb(126, 80, 79);">raq</span>.size(); <span class="" style="color: rgb(126, 80, 79);">i</span>++) {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> <span class="" style="color: rgb(126, 80, 79);">acs</span>.getRequestAttributes().add(<span class="" style="color: rgb(126, 80, 79);">raq</span>.get(<span class="" style="color: rgb(126, 80, 79);">i</span>));</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"> }</div></div><div class=""><br class=""></div><div class="">The output is without any attribute value over the Requested Attribute. Am I doing some stupid thing here? </div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(171, 69, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span><span class="" style="color: rgb(2, 29, 167);"><md:AttributeConsumingService</span><span class="" style="color: rgb(249, 151, 94);"> index</span><span class="" style="color: rgb(255, 148, 80);">=</span>"0"<span class="" style="color: rgb(249, 151, 94);"> isDefault</span><span class="" style="color: rgb(255, 148, 80);">=</span>"true"<span class="" style="color: rgb(2, 29, 167);">></span><span class="" style="color: rgb(0, 0, 0);"><br class=""> </span><span class="" style="color: rgb(2, 29, 167);"><md:ServiceName></span><span class="" style="color: rgb(0, 0, 0);">Service Name</span><span class="" style="color: rgb(2, 29, 167);"></md:ServiceName></span><span class="" style="color: rgb(0, 0, 0);"><br class=""> </span><span class="" style="color: rgb(2, 29, 167);"><md:ServiceDescription></span><span class="" style="color: rgb(0, 0, 0);">Service Description</span><span class="" style="color: rgb(2, 29, 167);"></md:ServiceDescription></span><span class="" style="color: rgb(0, 0, 0);"><br class=""> </span><span class="" style="color: rgb(2, 29, 167);"><md:RequestedAttribute</span><span class="" style="color: rgb(249, 151, 94);"> FriendlyName</span><span class="" style="color: rgb(255, 148, 80);">=</span>"XSPA Purpose Of Use"<span class="" style="color: rgb(249, 151, 94);"> Name</span><span class="" style="color: rgb(255, 148, 80);">=</span>"urn:oasis:names:tc:xspa:1.0:subject:purposeofuse"<span class="" style="color: rgb(249, 151, 94);"> NameFormat</span><span class="" style="color: rgb(255, 148, 80);">=</span>"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"<span class="" style="color: rgb(249, 151, 94);"> isRequired</span><span class="" style="color: rgb(255, 148, 80);">=</span>"true"<span class="" style="color: rgb(2, 29, 167);">/></span><span class="" style="color: rgb(0, 0, 0);"><br class=""> </span><span class="" style="color: rgb(2, 29, 167);"><md:RequestedAttribute</span><span class="" style="color: rgb(249, 151, 94);"> FriendlyName</span><span class="" style="color: rgb(255, 148, 80);">=</span>"XSPA Role"<span class="" style="color: rgb(249, 151, 94);"> Name</span><span class="" style="color: rgb(255, 148, 80);">=</span>"urn:oasis:names:tc:xacml:2.0:subject:role"<span class="" style="color: rgb(249, 151, 94);"> NameFormat</span><span class="" style="color: rgb(255, 148, 80);">=</span>"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"<span class="" style="color: rgb(249, 151, 94);"> isRequired</span><span class="" style="color: rgb(255, 148, 80);">=</span>"true"<span class="" style="color: rgb(2, 29, 167);">/></span><span class="" style="color: rgb(0, 0, 0);"><br class=""> </span><span class="" style="color: rgb(2, 29, 167);"></md:AttributeConsumingService></span></div></div></div>
<br class=""></body></html>