Skip to content

tweakingMetadata

Jim Potter edited this page Dec 14, 2021 · 1 revision

Tweaks

Settings default url and target override

Because you (may have) swapped out your AuthenticationSuccessHandler, you cannot set target URL in the main customize method, you need to add if to the new ly created successHandler: SAML2LoginSettings.java:

            setDefaultTargetUrl("/attributes");
            setTargetUrlParameter("target");
            setAlwaysUseDefaultTargetUrl(true);

Metadata tweaks

the default setting looks like it is setting entityID and endpoint urls based on the address you are calling it on metadata:

... 
entityID="http://localhost:8080/saml2/service-provider-metadata/MySAMLApp"
...
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://localhost:8080/login/saml2/sso/MySAMLApp" index="1"/>
...

This metadata is generateed on the fly from the url you are accessing the service from, so you can access it from a different URL (maybe through a reverse proxy/loadbalancer), and/or take a copy of the metadata, edit it and publish it elsewhere.

Clone this wiki locally