<div dir="ltr"><div>I probably should not bother sending this, because I figured it out, but I am sending it just in case someone enjoys reading through someone else's troubleshooting/pain. </div><div><br></div><div>----</div><div><br></div><div>I am experimenting with the metadata-driven attribute renaming as <a href="https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199510658/SAML2AttributeTranscoderConfiguration#Metadata-Based-Naming-5.1">documented</a>.</div><div>This is Shibboleth IdP 5.1.6. <span style="background-color:transparent">I have metadata-driven configuration working in general: attribute release, disabling assertion encryption, etc.</span></div><div><br></div><div>For my test case, I'm trying to switch the "last_name" attribute for Slack from using a dedicated AttributeDefinition to just renaming "sn".</div><div><br></div><div>From what I understand, I need to:</div><div>1. Disable the appropriate AttributeDefinition in "<span style="background-color:transparent">conf/attribute-resolver.xml" for the attribute I've given id="slack_last_name" (saml2 name="last_name").</span></div><div><span style="background-color:transparent">2. Reload attribute services and check with "aacli" that the attribute is gone.</span></div><div>3. Add "saml2.nameFromMetadata" to "conf/attributes/inetOrgPerson.xml" for id="sn":</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">--- a/conf/attributes/inetOrgPerson.xml<br>+++ b/conf/attributes/inetOrgPerson.xml<br>@@ -407,2 +407,3 @@<br>                     <prop key="id">sn</prop><br>+                    <prop key="saml2.nameFromMetadata">true</prop><br>                     <prop key="transcoder">SAML2StringTranscoder SAML1StringTranscoder</prop></blockquote><div>(I presume I can move this override to a custom property file once I've got it working.)</div><div>4. Ensure the attribute is not being filtered. I have existing rules that allow both "sn" and "last_name" (the latter for <a href="https://slack.com">https://slack.com</a> only).</div><div>5. Add the remap to the metadata:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">--- a/metadata/local/bbdf76bc0699a6b54c94731980fef51be1b20fb1.xml</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="background-color:transparent">+++ b/metadata/local/bbdf76bc0699a6b54c94731980fef51be1b20fb1.xml</span><span style="background-color:transparent"> </span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">@@ -14,6 +19,9 @@<span style="background-color:transparent"> </span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">      ... </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">     </saml2:Attribute><br>+      <saml2:Attribute Name="<a href="http://shibboleth.net/ns/attributes/naming/saml2">http://shibboleth.net/ns/attributes/naming/saml2</a>" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"><br>+        <saml2:AttributeValue>sn last_name</saml:AttributeValue><br>+    </saml2:Attribute><br>     </mdattr:EntityAttributes><br>   </Extensions></blockquote><div>6. Reload attribute services.</div><div>7. Reload metadata provider: "reload-metadata.sh -id local"</div><div>8. Run "aacli --saml2 -n wcooley -r <a href="https://slack.com">https://slack.com</a>" and see an attribute Name="last_name" (and presumably, no attribute Name="sn").</div><div><br></div><div>I have set idp.loglevel.root, net.shibboleth.idp.saml.attribute.mapping and net.shibboleth.idp.attribute.resolver to "DEBUG" in logback.xml. I see debug messages, but nothing is obvious, other than that it's still processing "sn" as "sn".</div><div><br></div><div>Update 1: I set "net.shibboleth.idp.attribute" to DEBUG and now I see this:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> - DEBUG [net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder:140] - 127.0.0.1||No tag values found for metadata-driven naming for sn</blockquote><div><br></div><div>Update 2: I have written all this out and while doing so, I see my problem. I thought, "I pretty much copied this from the wiki" and looked back at the example in the wiki and then remembered, "except I had to change the XML namespace prefix to match mine."</div><div><br></div><div><div>Do you see the error in the snippet of XML I included above?</div><div><br></div></div><div>How the heck did XML validation let this pass? "xmllint" makes no complaint about it.</div><div><br></div><div>Wil</div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Wil Cooley <wcooley(at)<a href="http://pdx.edu" target="_blank">pdx.edu</a>> </div><div>OIT-TI Identity and Access Management</div><div>Portland State University</div></div></div></div></div>