forked from cBioPortal/cbioportal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use RSA256 algorithm for SAML2 authN statement singing
Before, defaulted to insecure SHA1 algorithm. SHA1 support was dropped by Keycloak v22.
- Loading branch information
1 parent
49c95f0
commit 4ed5af1
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...src/main/java/org/cbioportal/security/spring/authentication/saml/SAMLBootstrapRSA256.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.cbioportal.security.spring.authentication.saml; | ||
|
||
import org.opensaml.Configuration; | ||
import org.opensaml.xml.security.BasicSecurityConfiguration; | ||
import org.opensaml.xml.signature.SignatureConstants; | ||
import org.springframework.beans.BeansException; | ||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | ||
import org.springframework.security.saml.SAMLBootstrap; | ||
|
||
public class SAMLBootstrapRSA256 extends SAMLBootstrap { | ||
@Override | ||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { | ||
super.postProcessBeanFactory(beanFactory); | ||
BasicSecurityConfiguration config = (BasicSecurityConfiguration) Configuration.getGlobalSecurityConfiguration(); | ||
config.registerSignatureAlgorithmURI("RSA", SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256); | ||
config.setSignatureReferenceDigestMethod(SignatureConstants.ALGO_ID_DIGEST_SHA256); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters