Shibboleth idp v5: Add custom extension to AuthnRequest on SAML proxy to upstream idp
Zhang, Jianjun
jianjun.zhang at afs.com
Mon May 12 18:03:13 UTC 2025
Hi,
I have a working shibboleth idp v5.1.4 SAML proxy that delegates the authentication to an upstream shibboleth idp. Now I'd like to add a custom extension to the SAML AuthnRequest that the proxy posts to the upstream idp so that I can add some more function on the upstream idp.
In a simplest form, I tried these steps:
1. Made a java class CustomExtension that either extends org.springframework.webflow.execution.Action, where I overrode execute() method; or extends org.opensaml.profile.ProfileRequestContext, where I overrode doExecute() method. Basically, just hardcoded a string value to a custom extension in AuthnRequest. Tried both implementations in the test with below config.
1. Configured a bean in global.xml for the java, like this:
<bean id="customExtension" class="CustomExtension"/>
1. Create a folder and file conf/intercept/inject-custom-extension/inject-custom-extension-flow.xml, like this:
<flow ...some_namespace_defs...>
<action-state id="injectCustomExtension">
<evaluate expression="customExtension"/>
<transition to="proceed"/>
</action-state>
<end-state id="proceed"/>
</flow>
1. In relying-party.xml, I have this to reference the injection flow:
<util:list id="shibboleth.RelyingPartyOverrides">
....
<bean id="dev-idp" parent="RelyingPartyByName" c:relyingPartyIds="...my_upstream_idp_entityID...">
<property name="profileConfigurations">
<list>
<bean parent="SAML2.SSO" p:outboundInterceptorFlows="inject-custom-extension"/>
</list>
</property>
</bean>
</util:list>
That's all the config I have. In the java code I have log.info() within the constructor and the overriding execute() method as soon as it gets into the method. Sent a SP request for the test and it went through like no effect from the interceptor. No errors either. Logs show the constructor of the java CustomExtension is called, but execute() (or doExecute() in the case for extending ProfileRequestContext) is never called.
Do you see the way I am doing this is correct? If this is totally non-starter, what is the right way to implement the task of adding acustom extension to AuthnRequest issued by the proxy idp?
Thank you so much in advance for any suggestion you can provide.
Johnny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20250512/532a08ed/attachment.htm>
More information about the users
mailing list