use sha256 with rsa keys for saml2, fix bug for authentication request's id

This commit is contained in:
Bernaldo Mihasi 2023-06-13 15:47:18 +03:00
parent 5cd1803e3a
commit 2aa1f76aab
1 changed files with 2 additions and 2 deletions

View File

@ -807,7 +807,7 @@ public class Saml2SSOUtils {
Credential credential = getCredential(provider.getSigningCert());
signature.setSigningCredential(credential);
signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_DSA_SHA256);
signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
signature.setCanonicalizationAlgorithm(SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
X509KeyInfoGeneratorFactory keyInfoGeneratorFactory = new X509KeyInfoGeneratorFactory();
@ -853,7 +853,7 @@ public class Saml2SSOUtils {
break;
}
authnRequest.setAssertionConsumerServiceURL(provider.getAssertionConsumerServiceUrl());
authnRequest.setID(UUID.randomUUID().toString());
authnRequest.setID('_' + UUID.randomUUID().toString());
authnRequest.setIssuer(buildIssuer(provider.getSpEntityId()));
authnRequest.setNameIDPolicy(buildNameIdPolicy());