diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f2d8780..cd23008 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + @@ -25,11 +26,11 @@ - + - - + + @@ -41,8 +42,10 @@ - - + + + + @@ -57,16 +60,16 @@ - + - - + + - - + + @@ -82,16 +85,6 @@ - - - - - - - - - - @@ -150,8 +143,8 @@ @@ -380,6 +373,22 @@ + + + + + + + @@ -401,6 +410,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -451,47 +543,54 @@ + + + + + + + + + - - - + - - + - + + + + + + + - - - - + + + + - - - - - - - - @@ -507,8 +606,8 @@ - - + + @@ -575,7 +674,9 @@ - + + + @@ -594,8 +695,8 @@ - - + + @@ -662,7 +763,9 @@ - + + + @@ -681,8 +784,8 @@ - - + + @@ -749,7 +852,9 @@ - + + + @@ -768,8 +873,8 @@ - - + + @@ -885,24 +990,6 @@ - - - - - - - - - - - - - - - - - - @@ -913,13 +1000,41 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/no/steras/opensamlbook/sp/AccessFilter.java b/src/main/java/no/steras/opensamlbook/sp/AccessFilter.java index 3075d5b..f75cc0a 100644 --- a/src/main/java/no/steras/opensamlbook/sp/AccessFilter.java +++ b/src/main/java/no/steras/opensamlbook/sp/AccessFilter.java @@ -21,8 +21,11 @@ import org.opensaml.saml.saml2.binding.encoding.impl.HTTPRedirectDeflateEncoder; import org.opensaml.saml.saml2.core.*; import org.opensaml.saml.saml2.metadata.Endpoint; import org.opensaml.saml.saml2.metadata.SingleSignOnService; +import org.opensaml.xmlsec.SecurityConfigurationSupport; +import org.opensaml.xmlsec.SignatureSigningConfiguration; import org.opensaml.xmlsec.SignatureSigningParameters; import org.opensaml.xmlsec.context.SecurityParametersContext; +import org.opensaml.xmlsec.signature.support.SignatureConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -98,7 +101,10 @@ public class AccessFilter implements Filter { SignatureSigningParameters signatureSigningParameters = new SignatureSigningParameters(); signatureSigningParameters.setSigningCredential(SPCredentials.getCredential()); - context.getSubcontext(SecurityParametersContext.class, true).setSignatureSigningParameters(); + signatureSigningParameters.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256); + + + context.getSubcontext(SecurityParametersContext.class, true).setSignatureSigningParameters(signatureSigningParameters); context.setMessage(authnRequest); diff --git a/src/main/java/no/steras/opensamlbook/sp/SPCredentials.java b/src/main/java/no/steras/opensamlbook/sp/SPCredentials.java index 8b1a083..ff09126 100644 --- a/src/main/java/no/steras/opensamlbook/sp/SPCredentials.java +++ b/src/main/java/no/steras/opensamlbook/sp/SPCredentials.java @@ -37,6 +37,7 @@ public class SPCredentials { Criterion criterion = new EntityIdCriterion(KEY_ENTRY_ID); CriteriaSet criteriaSet = new CriteriaSet(); + criteriaSet.add(criterion); credential = resolver.resolveSingle(criteriaSet);