<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Spring Security SAML &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/spring-security-saml/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 16:37:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>Spring Security SAML &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>Spring Security SAML: Replacing SHA-1 with SHA-256 on Signature and Digest Algorithms</title>
		<link>https://myshittycode.com/2016/02/23/spring-security-saml-replacing-sha-1-with-sha-256-on-signature-and-digest-algorithms/</link>
					<comments>https://myshittycode.com/2016/02/23/spring-security-saml-replacing-sha-1-with-sha-256-on-signature-and-digest-algorithms/#comments</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Tue, 23 Feb 2016 20:20:08 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring Security SAML]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=909</guid>

					<description><![CDATA[<p>PROBLEM By default, Spring Security SAML&#8217;s SAMLBootstrap uses SHA1withRSA for signature algorithm and SHA-1 for digest algorithm. For example, the above configuration will generate the following SAML request payload when using HTTP-POST binding:- Unfortunately, SHA-1 is now deemed insecure due to &#8220;Freestart Collision&#8221; attack. Further, most modern browsers have ceased to trust SHA-1 code signing [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2016/02/23/spring-security-saml-replacing-sha-1-with-sha-256-on-signature-and-digest-algorithms/">Spring Security SAML: Replacing SHA-1 with SHA-256 on Signature and Digest Algorithms</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>By default, Spring Security SAML&#8217;s <b>SAMLBootstrap</b> uses SHA1withRSA for signature algorithm and SHA-1 for digest algorithm.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; highlight: [8]; title: ; notranslate">
@Configuration
@EnableWebSecurity
public abstract class AppSAMLConfig extends WebSecurityConfigurerAdapter {
	...

    @Bean
    public static SAMLBootstrap SAMLBootstrap() {
        return new SAMLBootstrap();
    }

	...
}
</pre></div>


<p>For example, the above configuration will generate the following SAML request payload when using HTTP-POST binding:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [13,19]; title: ; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;
&lt;saml2p:authnrequest assertionconsumerserviceurl=&quot;https://server/app/saml/SSO&quot; destination=&quot;https://adfs-server/adfs/ls/&quot; forceauthn=&quot;true&quot; id=&quot;a3bj4e05i70f6946gi85299i51i02a&quot; ispassive=&quot;false&quot; issueinstant=&quot;2016-02-23T15:10:26.414Z&quot; protocolbinding=&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot; version=&quot;2.0&quot; xmlns:saml2p=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;&gt;
    &lt;saml2:issuer xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;https://server/app/saml/metadata&lt;/saml2:issuer&gt;
    &lt;ds:signature xmlns:ds=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;
        &lt;ds:signedinfo&gt;
            &lt;ds:canonicalizationmethod algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;&gt;
            &lt;ds:signaturemethod algorithm=&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;&gt;
            &lt;ds:reference uri=&quot;#a3bj4e05i70f6946gi85299i51i02a&quot;&gt;
                &lt;ds:transforms&gt;
                    &lt;ds:transform algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;&gt;
                    &lt;ds:transform algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;&gt;
                &lt;/ds:transform&gt;&lt;/ds:transform&gt;&lt;/ds:transforms&gt;
                &lt;ds:digestmethod algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;&gt;
                &lt;ds:digestvalue&gt;u25hV7rk8hIpXYLJQs0aZjkueP0=&lt;/ds:digestvalue&gt;
            &lt;/ds:digestmethod&gt;&lt;/ds:reference&gt;
        &lt;/ds:signaturemethod&gt;&lt;/ds:canonicalizationmethod&gt;&lt;/ds:signedinfo&gt;
        &lt;ds:signaturevalue&gt;YDR9ybi...&lt;/ds:signaturevalue&gt;
        &lt;ds:keyinfo&gt;
            &lt;ds:x509data&gt;
                &lt;ds:x509certificate&gt;MIICxz...&lt;/ds:x509certificate&gt;
            &lt;/ds:x509data&gt;
        &lt;/ds:keyinfo&gt;
    &lt;/ds:signature&gt;
    &lt;saml2p:requestedauthncontext comparison=&quot;exact&quot;&gt;
        &lt;saml2:authncontextclassref xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;urn:oasis:names:tc:SAML:2.0:ac:classes:Password&lt;/saml2:authncontextclassref&gt;
    &lt;/saml2p:requestedauthncontext&gt;
&lt;/saml2p:authnrequest&gt;
</pre></div>


<p>Unfortunately, SHA-1 is now deemed insecure due to <a href="https://sites.google.com/site/itstheshappening/" target="_blank" rel="noopener">&#8220;Freestart Collision&#8221; attack</a>.</p>



<p>Further, most modern browsers have ceased to trust SHA-1 code signing certificates starting January 2016 and will eventually stop accepting these certificates by January 2017.</p>



<h2 class="wp-block-heading">SOLUTION</h2>



<p>To fix this, we could replace SHA-1 with stronger secure hash algorithm, such as SHA-256.</p>



<p>To do so, create a class that extends <b>SAMLBootstrap</b> that uses SHA256withRSA for signature algorithm and SHA-256 for digest algorithm.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; highlight: [6,7]; title: ; notranslate">
public final class CustomSAMLBootstrap extends SAMLBootstrap {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        super.postProcessBeanFactory(beanFactory);
        BasicSecurityConfiguration config = (BasicSecurityConfiguration) Configuration.getGlobalSecurityConfiguration();
        config.registerSignatureAlgorithmURI(&quot;RSA&quot;, SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
        config.setSignatureReferenceDigestMethod(SignatureConstants.ALGO_ID_DIGEST_SHA256);
    }
}
</pre></div>


<p>Then, return <b>CustomSAMLBootstrap</b> instead of <b>SAMLBootstrap</b></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; highlight: [8]; title: ; notranslate">
@Configuration
@EnableWebSecurity
public abstract class AppSAMLConfig extends WebSecurityConfigurerAdapter {
	...

    @Bean
    public static SAMLBootstrap SAMLBootstrap() {
        return new CustomSAMLBootstrap();
    }

	...
}
</pre></div>


<p>Now, the generated SAML request payload using HTTP-POST binding looks like this:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; highlight: [13,19]; title: ; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;
&lt;saml2p:authnrequest assertionconsumerserviceurl=&quot;https://server/app/saml/SSO&quot; destination=&quot;https://adfs-server/adfs/ls/&quot; forceauthn=&quot;true&quot; id=&quot;a2e7f98agfaec7d253714fjdbcf8a83&quot; ispassive=&quot;false&quot; issueinstant=&quot;2016-02-23T15:18:43.452Z&quot; protocolbinding=&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot; version=&quot;2.0&quot; xmlns:saml2p=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;&gt;
    &lt;saml2:issuer xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;https://server/app/saml/metadata&lt;/saml2:issuer&gt;
    &lt;ds:signature xmlns:ds=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;
        &lt;ds:signedinfo&gt;
            &lt;ds:canonicalizationmethod algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;&gt;
            &lt;ds:signaturemethod algorithm=&quot;http://www.w3.org/2001/04/xmldsig-more#rsa-sha256&quot;&gt;
            &lt;ds:reference uri=&quot;#a2e7f98agfaec7d253714fjdbcf8a83&quot;&gt;
                &lt;ds:transforms&gt;
                    &lt;ds:transform algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;&gt;
                    &lt;ds:transform algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;&gt;
                &lt;/ds:transform&gt;&lt;/ds:transform&gt;&lt;/ds:transforms&gt;
                &lt;ds:digestmethod algorithm=&quot;http://www.w3.org/2001/04/xmlenc#sha256&quot;&gt;
                &lt;ds:digestvalue&gt;w4qHFsBxFGifzemEJCYcuGOt+oZJ9N2DQM+Q2aEqJFI=&lt;/ds:digestvalue&gt;
            &lt;/ds:digestmethod&gt;&lt;/ds:reference&gt;
        &lt;/ds:signaturemethod&gt;&lt;/ds:canonicalizationmethod&gt;&lt;/ds:signedinfo&gt;
        &lt;ds:signaturevalue&gt;YDR9ybi...&lt;/ds:signaturevalue&gt;
        &lt;ds:keyinfo&gt;
            &lt;ds:x509data&gt;
                &lt;ds:x509certificate&gt;MIICxz...&lt;/ds:x509certificate&gt;
            &lt;/ds:x509data&gt;
        &lt;/ds:keyinfo&gt;
    &lt;/ds:signature&gt;
    &lt;saml2p:requestedauthncontext comparison=&quot;exact&quot;&gt;
        &lt;saml2:authncontextclassref xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;urn:oasis:names:tc:SAML:2.0:ac:classes:Password&lt;/saml2:authncontextclassref&gt;
    &lt;/saml2p:requestedauthncontext&gt;
&lt;/saml2p:authnrequest&gt;
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2016/02/23/spring-security-saml-replacing-sha-1-with-sha-256-on-signature-and-digest-algorithms/">Spring Security SAML: Replacing SHA-1 with SHA-256 on Signature and Digest Algorithms</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2016/02/23/spring-security-saml-replacing-sha-1-with-sha-256-on-signature-and-digest-algorithms/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">909</post-id>	</item>
		<item>
		<title>Spring Security SAML: Handling IdP&#8217;s Public Certificate When Loading Metadata Over HTTPS</title>
		<link>https://myshittycode.com/2016/02/19/spring-security-saml-handling-idps-public-certificate-when-loading-metadata-over-https/</link>
					<comments>https://myshittycode.com/2016/02/19/spring-security-saml-handling-idps-public-certificate-when-loading-metadata-over-https/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Fri, 19 Feb 2016 20:15:11 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring Security SAML]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=905</guid>

					<description><![CDATA[<p>PROBLEM By default, when loading IdP&#8217;s metadata over HTTPS (ex: https://adfs-server/federationmetadata/2007-06/federationmetadata.xml), Spring Security SAML will perform the trust verification configured in JDK. However, there are times we do not have direct access to JDK home directory especially if the web apps are hosted on someone else&#8217;s JEE or PaaS servers. SOLUTION To fix this, the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2016/02/19/spring-security-saml-handling-idps-public-certificate-when-loading-metadata-over-https/">Spring Security SAML: Handling IdP&#8217;s Public Certificate When Loading Metadata Over HTTPS</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>By default, when loading IdP&#8217;s metadata over HTTPS (ex: https://adfs-server/federationmetadata/2007-06/federationmetadata.xml), Spring Security SAML will perform the trust verification configured in JDK.</p>



<p>However, there are times we do not have direct access to JDK home directory especially if the web apps are hosted on someone else&#8217;s JEE or PaaS servers.</p>



<h2 class="wp-block-heading">SOLUTION</h2>



<p>To fix this, the IdP&#8217;s public certificate can be imported into the app&#8217;s keystore instead of JDK&#8217;s keystore.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
keytool -importcert -file adfs-server.cer -keystore app-keystore.jks -alias &quot;adfs-server&quot;
</pre></div>


<p>Then, configure Spring Security SAML to use <b>TLSProtocolConfigurer</b>, which will use all public certificates stored in the app&#8217;s keystore as trust anchors for PKIX validation.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; title: ; notranslate">
@Configuration
@EnableWebSecurity
public abstract class SecuritySAMLConfig extends WebSecurityConfigurerAdapter {

    ...

	// in this case, `app-keystore.jks` contains the app&#039;s public/private keys and
	// the imported IdP&#039;s public certificate
    @Bean
    public KeyManager keyManager() {
        DefaultResourceLoader loader = new DefaultResourceLoader();
        Resource storeFile = loader.getResource(&quot;classpath:app-keystore.jks&quot;);
        Map&lt;string, string=&quot;&quot;&gt; passwords = new HashMap&amp;lt;&amp;gt;();
        passwords.put(&quot;app_alias&quot;, &quot;app_password&quot;);
        return new JKSKeyManager(storeFile, &quot;app_password&quot;, passwords, &quot;app_alias&quot;);
    }

    @Bean
    public TLSProtocolConfigurer tlsProtocolConfigurer() {
        return new TLSProtocolConfigurer();
    }

    @Bean
    public ProtocolSocketFactory protocolSocketFactory(KeyManager keyManager) {
        return new TLSProtocolSocketFactory(keyManager, null, &quot;default&quot;);
    }

    @Bean
    public Protocol protocol(ProtocolSocketFactory protocolSocketFactory) {
        return new Protocol(&quot;https&quot;, protocolSocketFactory, 443);
    }

    @Bean
    public MethodInvokingFactoryBean socketFactoryInitialization(Protocol protocol) {
        MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
        methodInvokingFactoryBean.setTargetClass(Protocol.class);
        methodInvokingFactoryBean.setTargetMethod(&quot;registerProtocol&quot;);
        Object&#x5B;] args = {&quot;https&quot;, protocol};
        methodInvokingFactoryBean.setArguments(args);
        return methodInvokingFactoryBean;
    }

    ...
}
</pre></div>


<p>Doing so makes the app more portable so that it can be deployed into any JEE or PaaS servers without any problem.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2016/02/19/spring-security-saml-handling-idps-public-certificate-when-loading-metadata-over-https/">Spring Security SAML: Handling IdP&#8217;s Public Certificate When Loading Metadata Over HTTPS</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2016/02/19/spring-security-saml-handling-idps-public-certificate-when-loading-metadata-over-https/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">905</post-id>	</item>
		<item>
		<title>Spring Security SAML: Configuring Binding for Sending SAML Messages to IdP</title>
		<link>https://myshittycode.com/2016/02/18/spring-security-saml-configuring-binding-for-sending-saml-messages-to-idp/</link>
					<comments>https://myshittycode.com/2016/02/18/spring-security-saml-configuring-binding-for-sending-saml-messages-to-idp/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Thu, 18 Feb 2016 19:15:20 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring Security SAML]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=896</guid>

					<description><![CDATA[<p>PROBLEM Depending on each institution&#8217;s Identity Provider (IdP) configuration, the Service Provider (Sp) may need to configure the correct binding for sending SAML messages to IdP. SOLUTION Using Spring Security SAML, the binding configuration is highlighted below:- HTTP-POST Binding Configuration:- Using HTTP-POST binding, the SAML message to IdP will contain the signature information:- HTTP-Redirect Binding [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2016/02/18/spring-security-saml-configuring-binding-for-sending-saml-messages-to-idp/">Spring Security SAML: Configuring Binding for Sending SAML Messages to IdP</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>Depending on each institution&#8217;s Identity Provider (IdP) configuration, the Service Provider (Sp) may need to configure the correct binding for sending SAML messages to IdP.</p>



<h2 class="wp-block-heading">SOLUTION</h2>



<p>Using Spring Security SAML, the binding configuration is highlighted below:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; highlight: [11]; title: ; notranslate">
@Configuration
@EnableWebSecurity
public abstract class SecuritySAMLConfig extends WebSecurityConfigurerAdapter {

	...

    @Bean
    public WebSSOProfileOptions webSSOProfileOptions() {
        WebSSOProfileOptions webSSOProfileOptions = new WebSSOProfileOptions();
        webSSOProfileOptions.setIncludeScoping(false);
        webSSOProfileOptions.setBinding(...);
    }

    @Bean
    public SAMLEntryPoint samlEntryPoint(WebSSOProfileOptions webSSOProfileOptions) {
        SAMLEntryPoint samlEntryPoint = new SAMLEntryPoint();
        samlEntryPoint.setDefaultProfileOptions(webSSOProfileOptions);
        return samlEntryPoint;
    }

	...
}
</pre></div>


<h3 class="wp-block-heading">HTTP-POST Binding</h3>



<p>Configuration:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; title: ; notranslate">
webSSOProfileOptions.setBinding(SAMLConstants.SAML2_POST_BINDING_URI);
</pre></div>


<p>Using HTTP-POST binding, the SAML message to IdP will contain the signature information:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;
&lt;samlp:response consent=&quot;urn:oasis:names:tc:SAML:2.0:consent:unspecified&quot; destination=&quot;https://server/my-app/saml/SSO&quot; id=&quot;_370d6ba5-177c-494b-9147-2eafd9ecb6c9&quot; inresponseto=&quot;a5c5dja1i5fgb2bf2e66f6g9g5398gj&quot; issueinstant=&quot;2016-02-18T15:28:43.473Z&quot; version=&quot;2.0&quot; xmlns:samlp=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;&gt;
    &lt;issuer xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;http://adfs-server/adfs/services/trust&lt;/issuer&gt;
    &lt;samlp:status&gt;
        &lt;samlp:statuscode value=&quot;urn:oasis:names:tc:SAML:2.0:status:Success&quot;&gt;
    &lt;/samlp:statuscode&gt;&lt;/samlp:status&gt;
    &lt;encryptedassertion xmlns=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;
        &lt;xenc:encrypteddata type=&quot;http://www.w3.org/2001/04/xmlenc#Element&quot; xmlns:xenc=&quot;http://www.w3.org/2001/04/xmlenc#&quot;&gt;
            &lt;xenc:encryptionmethod algorithm=&quot;http://www.w3.org/2001/04/xmlenc#aes256-cbc&quot;&gt;
            &lt;keyinfo xmlns=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;
                &lt;e:encryptedkey xmlns:e=&quot;http://www.w3.org/2001/04/xmlenc#&quot;&gt;
                    &lt;e:encryptionmethod algorithm=&quot;http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p&quot;&gt;
                        &lt;digestmethod algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;&gt;
                    &lt;/digestmethod&gt;&lt;/e:encryptionmethod&gt;
                    &lt;keyinfo&gt;
                        &lt;ds:x509data xmlns:ds=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;
                            &lt;ds:x509issuerserial&gt;
                                &lt;ds:x509issuername&gt;CN=server&lt;/ds:x509issuername&gt;
                                &lt;ds:x509serialnumber&gt;1822784706&lt;/ds:x509serialnumber&gt;
                            &lt;/ds:x509issuerserial&gt;
                        &lt;/ds:x509data&gt;
                    &lt;/keyinfo&gt;
                    &lt;e:cipherdata&gt;
                        &lt;e:ciphervalue&gt;isG83fVk50fJRI...&lt;/e:ciphervalue&gt;
                    &lt;/e:cipherdata&gt;
                &lt;/e:encryptedkey&gt;
            &lt;/keyinfo&gt;
            &lt;xenc:cipherdata&gt;
                &lt;xenc:ciphervalue&gt;+b2o6HNxaxsse7rkB...&lt;/xenc:ciphervalue&gt;
            &lt;/xenc:cipherdata&gt;
        &lt;/xenc:encryptionmethod&gt;&lt;/xenc:encrypteddata&gt;
    &lt;/encryptedassertion&gt;
&lt;/samlp:response&gt;
</pre></div>


<h3 class="wp-block-heading">HTTP-Redirect Binding</h3>



<p>Configuration:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; title: ; notranslate">
webSSOProfileOptions.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
</pre></div>


<p>Using SAML2_REDIRECT_BINDING_URI binding, the signature will be removed before the message is delivered. The signature is then performed on the serialized request and sent as a GET parameter.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;
&lt;saml2p:authnrequest xmlns:saml2p=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot; assertionconsumerserviceurl=&quot;https://server/my-app/saml/SSO&quot; destination=&quot;https://adfs-server/adfs/ls/&quot; forceauthn=&quot;false&quot; id=&quot;a4719398gd37jgg464505g70i40a49&quot; ispassive=&quot;false&quot; issueinstant=&quot;2016-02-18T15:24:59.036Z&quot; protocolbinding=&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot; version=&quot;2.0&quot;&gt;
    &lt;saml2:issuer xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;https://server/my-app/saml/metadata&lt;/saml2:issuer&gt;
&lt;/saml2p:authnrequest&gt;
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2016/02/18/spring-security-saml-configuring-binding-for-sending-saml-messages-to-idp/">Spring Security SAML: Configuring Binding for Sending SAML Messages to IdP</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2016/02/18/spring-security-saml-configuring-binding-for-sending-saml-messages-to-idp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">896</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching using Disk (Request-wide modification query)

Served from: myshittycode.com @ 2026-03-03 06:00:45 by W3 Total Cache
-->