<div dir="ltr"><div dir="ltr">Thanks, Scott.<div><br></div><div>As the script already needs the attribute resolver service passed in via the custom object, I've gone for something along these lines (using entityID purely as an example property):</div><div><br></div><div><div style="line-height:19px"><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">    <span style="color:rgb(128,0,0)"><util:map</span> <span style="color:rgb(229,0,0)">id</span>=<span style="color:rgb(0,0,255)">"customObjectMap"</span><span style="color:rgb(128,0,0)">></span></div><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">        <span style="color:rgb(128,0,0)"><entry</span> <span style="color:rgb(229,0,0)">key</span>=<span style="color:rgb(0,0,255)">"entityID"</span> <span style="color:rgb(229,0,0)">value</span>=<span style="color:rgb(0,0,255)">"%{idp.entityID:borked}"</span> <span style="color:rgb(128,0,0)">/></span></div><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">        <span style="color:rgb(128,0,0)"><entry</span> <span style="color:rgb(229,0,0)">key</span>=<span style="color:rgb(0,0,255)">"attributeResolverService"</span> <span style="color:rgb(229,0,0)">value-ref</span>=<span style="color:rgb(0,0,255)">"shibboleth.AttributeResolverService"</span> <span style="color:rgb(128,0,0)">/></span></div><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">    <span style="color:rgb(128,0,0)"></util:map></span></div><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">    <span style="color:rgb(128,0,0)"><bean</span> <span style="color:rgb(229,0,0)">id</span>=<span style="color:rgb(0,0,255)">"checkSecondFactor"</span> <span style="color:rgb(229,0,0)">parent</span>=<span style="color:rgb(0,0,255)">"shibboleth.ContextFunctions.Scripted"</span> <span style="color:rgb(229,0,0)">factory-method</span>=<span style="color:rgb(0,0,255)">"resourceScript"</span></div><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">          <span style="color:rgb(229,0,0)">c:resource</span>=<span style="color:rgb(0,0,255)">"%{idp.home}/conf/authn/checkSecondFactor.js"</span></div><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">          <span style="color:rgb(229,0,0)">c:outputType</span>=<span style="color:rgb(0,0,255)">"java.lang.String"</span></div><div style="font-family:"Fira Code","DejaVu Sans Mono",monospace,"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;color:rgb(59,59,59)">          <span style="color:rgb(229,0,0)">p:customObject-ref</span>=<span style="color:rgb(0,0,255)">"customObjectMap"</span> <span style="color:rgb(128,0,0)">/></span></div><br>My spring fu is limited but that seems to do the trick. The script then has access to custom.entityID and custom.attributeResolverService.<br></div></div><div style="line-height:19px"><br></div><div style="line-height:19px">Cheers,</div><div style="line-height:19px"><br></div><div style="line-height:19px">Max</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 17 Nov 2023 at 13:01, Cantor, Scott <<a href="mailto:cantor.2@osu.edu">cantor.2@osu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Are the properties defined in idp.properties etc accessible from such<br>
> scripts?<br>
<br>
They're part of the Spring environment, but it's a bit tricky to get at it (except from Java, where it's trivial), you need to get at the ApplicationContext interface to do it programatically.<br>
<br>
What I would probably do were it me, to avoid extra code, is to inject specific properties into custom objects and then inject the custom objects into the script in the usual way.<br>
<br>
Populate a map with anything you need basically.<br>
<br>
<util:map id="..."><br>
        <entry key="foo" value="%{name:default}" /><br>
</util:map><br>
<br>
-- Scott<br>
<br></blockquote></div></div>