From 60f954a497687be15c27cfae172723c95e6b604e Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Thu, 26 May 2016 10:48:30 -0300 Subject: [PATCH] [KEYCLOAK-2894] - Fixing saml signature validation --- .../subsystem/saml/as7/Constants.java | 2 + .../saml/as7/SingleSignOnDefinition.java | 7 +- .../saml/as7/LocalDescriptions.properties | 1 + .../schema/wildfly-keycloak-saml_1_1.xsd | 5 ++ .../subsystem/saml/as7/keycloak-saml-1.1.xml | 1 + .../adapters/saml/DefaultSamlDeployment.java | 10 +++ .../adapters/saml/SamlDeployment.java | 1 + .../keycloak/adapters/saml/config/IDP.java | 9 +++ .../config/parsers/ConfigXmlConstants.java | 1 + .../config/parsers/DeploymentBuilder.java | 1 + .../saml/config/parsers/IDPXmlParser.java | 1 + .../AbstractSamlAuthenticationHandler.java | 31 ++++++++- .../schema/keycloak_saml_adapter_1_6.xsd | 1 + .../adapter/saml/extension/Constants.java | 2 + .../extension/SingleSignOnDefinition.java | 7 +- .../extension/LocalDescriptions.properties | 1 + .../schema/wildfly-keycloak-saml_1_1.xsd | 5 ++ .../saml/extension/keycloak-saml-1.1-err.xml | 1 + .../saml/extension/keycloak-saml-1.1.xml | 1 + .../core/util/XMLSignatureUtil.java | 3 +- .../KeycloakSamlClientInstallation.java | 1 + .../keycloaksaml/SamlAdapterTest.java | 18 +++++ .../keycloaksaml/SamlAdapterTestStrategy.java | 36 ++++++++++ .../WEB-INF/keycloak-saml.xml | 62 ++++++++++++++++++ .../WEB-INF/keystore.jks | Bin 0 -> 1715 bytes .../WEB-INF/keycloak-saml.xml | 60 +++++++++++++++++ .../WEB-INF/keystore.jks | Bin 0 -> 1705 bytes .../WEB-INF/keycloak-saml.xml | 60 +++++++++++++++++ .../WEB-INF/keystore.jks | Bin 0 -> 1705 bytes .../resources/keycloak-saml/testsaml.json | 62 ++++++++++++++++++ 30 files changed, 384 insertions(+), 6 deletions(-) create mode 100755 testsuite/integration/src/test/resources/keycloak-saml/bad-assertion-signed-post/WEB-INF/keycloak-saml.xml create mode 100755 testsuite/integration/src/test/resources/keycloak-saml/bad-assertion-signed-post/WEB-INF/keystore.jks create mode 100755 testsuite/integration/src/test/resources/keycloak-saml/missing-assertion-sig/WEB-INF/keycloak-saml.xml create mode 100755 testsuite/integration/src/test/resources/keycloak-saml/missing-assertion-sig/WEB-INF/keystore.jks create mode 100755 testsuite/integration/src/test/resources/keycloak-saml/sales-post-assertion-and-response-sig/WEB-INF/keycloak-saml.xml create mode 100755 testsuite/integration/src/test/resources/keycloak-saml/sales-post-assertion-and-response-sig/WEB-INF/keystore.jks diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Constants.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Constants.java index 81c697a237..7d30f7f089 100755 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Constants.java +++ b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Constants.java @@ -45,6 +45,7 @@ public class Constants { static final String KEY_STORE = "KeyStore"; static final String SIGN_REQUEST = "signRequest"; static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature"; + static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature"; static final String REQUEST_BINDING = "requestBinding"; static final String BINDING_URL = "bindingUrl"; static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature"; @@ -97,6 +98,7 @@ public class Constants { static final String CERTIFICATE_ALIAS = "alias"; static final String SIGN_REQUEST = "signRequest"; static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature"; + static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature"; static final String REQUEST_BINDING = "requestBinding"; static final String BINDING_URL = "bindingUrl"; static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature"; diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleSignOnDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleSignOnDefinition.java index 9f7732a0f9..61c55d8e24 100644 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleSignOnDefinition.java +++ b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleSignOnDefinition.java @@ -37,6 +37,11 @@ abstract class SingleSignOnDefinition { .setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE) .build(); + static final SimpleAttributeDefinition VALIDATE_ASSERTION_SIGNATURE = + new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_ASSERTION_SIGNATURE, ModelType.BOOLEAN, true) + .setXmlName(Constants.XML.VALIDATE_ASSERTION_SIGNATURE) + .build(); + static final SimpleAttributeDefinition REQUEST_BINDING = new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true) .setXmlName(Constants.XML.REQUEST_BINDING) @@ -52,7 +57,7 @@ abstract class SingleSignOnDefinition { .setXmlName(Constants.XML.BINDING_URL) .build(); - static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL}; + static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, VALIDATE_ASSERTION_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL}; static final HashMap ATTRIBUTE_MAP = new HashMap<>(); diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/org/keycloak/subsystem/saml/as7/LocalDescriptions.properties b/adapters/saml/as7-eap6/subsystem/src/main/resources/org/keycloak/subsystem/saml/as7/LocalDescriptions.properties index 6add1e428f..819623516d 100755 --- a/adapters/saml/as7-eap6/subsystem/src/main/resources/org/keycloak/subsystem/saml/as7/LocalDescriptions.properties +++ b/adapters/saml/as7-eap6/subsystem/src/main/resources/org/keycloak/subsystem/saml/as7/LocalDescriptions.properties @@ -67,6 +67,7 @@ keycloak-saml.IDP.signatureCanonicalizationMethod=Signature canonicalization met keycloak-saml.IDP.SingleSignOnService=Single sign-on configuration keycloak-saml.IDP.SingleSignOnService.signRequest=Sign SSO requests keycloak-saml.IDP.SingleSignOnService.validateResponseSignature=Validate an SSO response signature +keycloak-saml.IDP.SingleSignOnService.validateAssertionSignature=Validate an SSO assertion signature keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd b/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd index fb893dd155..0494a1e2d5 100755 --- a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd +++ b/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd @@ -132,6 +132,11 @@ Validate the SSO response signature + + + Validate the SSO assertion signature + + HTTP method to use for requests diff --git a/adapters/saml/as7-eap6/subsystem/src/test/resources/org/keycloak/subsystem/saml/as7/keycloak-saml-1.1.xml b/adapters/saml/as7-eap6/subsystem/src/test/resources/org/keycloak/subsystem/saml/as7/keycloak-saml-1.1.xml index 31ed63089d..2380642fc5 100644 --- a/adapters/saml/as7-eap6/subsystem/src/test/resources/org/keycloak/subsystem/saml/as7/keycloak-saml-1.1.xml +++ b/adapters/saml/as7-eap6/subsystem/src/test/resources/org/keycloak/subsystem/saml/as7/keycloak-saml-1.1.xml @@ -42,6 +42,7 @@ + diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/Constants.java b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/Constants.java index c7d5acce38..46bfaeda3c 100755 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/Constants.java +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/Constants.java @@ -45,6 +45,7 @@ public class Constants { static final String KEY_STORE = "KeyStore"; static final String SIGN_REQUEST = "signRequest"; static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature"; + static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature"; static final String REQUEST_BINDING = "requestBinding"; static final String BINDING_URL = "bindingUrl"; static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature"; @@ -97,6 +98,7 @@ public class Constants { static final String CERTIFICATE_ALIAS = "alias"; static final String SIGN_REQUEST = "signRequest"; static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature"; + static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature"; static final String REQUEST_BINDING = "requestBinding"; static final String BINDING_URL = "bindingUrl"; static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature"; diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SingleSignOnDefinition.java b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SingleSignOnDefinition.java index 8a565a3115..d0d95b1c1c 100644 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SingleSignOnDefinition.java +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SingleSignOnDefinition.java @@ -37,6 +37,11 @@ abstract class SingleSignOnDefinition { .setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE) .build(); + static final SimpleAttributeDefinition VALIDATE_ASSERTION_SIGNATURE = + new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_ASSERTION_SIGNATURE, ModelType.BOOLEAN, true) + .setXmlName(Constants.XML.VALIDATE_ASSERTION_SIGNATURE) + .build(); + static final SimpleAttributeDefinition REQUEST_BINDING = new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true) .setXmlName(Constants.XML.REQUEST_BINDING) @@ -52,7 +57,7 @@ abstract class SingleSignOnDefinition { .setXmlName(Constants.XML.BINDING_URL) .build(); - static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL}; + static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, VALIDATE_ASSERTION_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL}; static final HashMap ATTRIBUTE_MAP = new HashMap<>(); diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/saml/extension/LocalDescriptions.properties b/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/saml/extension/LocalDescriptions.properties index 6add1e428f..819623516d 100755 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/saml/extension/LocalDescriptions.properties +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/org/keycloak/subsystem/adapter/saml/extension/LocalDescriptions.properties @@ -67,6 +67,7 @@ keycloak-saml.IDP.signatureCanonicalizationMethod=Signature canonicalization met keycloak-saml.IDP.SingleSignOnService=Single sign-on configuration keycloak-saml.IDP.SingleSignOnService.signRequest=Sign SSO requests keycloak-saml.IDP.SingleSignOnService.validateResponseSignature=Validate an SSO response signature +keycloak-saml.IDP.SingleSignOnService.validateAssertionSignature=Validate an SSO assertion signature keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd b/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd index fb893dd155..0494a1e2d5 100755 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd @@ -132,6 +132,11 @@ Validate the SSO response signature + + + Validate the SSO assertion signature + + HTTP method to use for requests diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1-err.xml b/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1-err.xml index ed56cccc65..5afd0bf721 100644 --- a/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1-err.xml +++ b/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1-err.xml @@ -42,6 +42,7 @@ diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1.xml b/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1.xml index d8183087b3..f703c58dd4 100755 --- a/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1.xml +++ b/adapters/saml/wildfly/wildfly-subsystem/src/test/resources/org/keycloak/subsystem/adapter/saml/extension/keycloak-saml-1.1.xml @@ -44,6 +44,7 @@ diff --git a/saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLSignatureUtil.java b/saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLSignatureUtil.java index c1b5ef084d..bd07882e50 100755 --- a/saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLSignatureUtil.java +++ b/saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLSignatureUtil.java @@ -370,7 +370,8 @@ public class XMLSignatureUtil { NodeList nl = signedDoc.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature"); if (nl == null || nl.getLength() == 0) { - throw logger.nullValueError("Cannot find Signature element"); + logger.debug("Cannot find Signature element"); + return false; } if (publicKey == null) diff --git a/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlClientInstallation.java b/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlClientInstallation.java index ca9de35cd9..4a91db950b 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlClientInstallation.java +++ b/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlClientInstallation.java @@ -96,6 +96,7 @@ public class KeycloakSamlClientInstallation implements ClientInstallationProvide buffer.append(">\n"); buffer.append(" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/integration/src/test/resources/keycloak-saml/bad-assertion-signed-post/WEB-INF/keystore.jks b/testsuite/integration/src/test/resources/keycloak-saml/bad-assertion-signed-post/WEB-INF/keystore.jks new file mode 100755 index 0000000000000000000000000000000000000000..215384cdef8f651b392ec1ce469adffdb9e4a521 GIT binary patch literal 1715 zcmezO_TO6u1_mZ5W@OOMC@Cqh($~+)PfpCq$S*FjvM{hP)K5xG(Je|%%*oX)PRvOy z)-3?a=oV+D>oYJgdg`0JY6hCI)1ZlIs{tPymo^(C3!@g3AR{9y14|Rr!ngU6+@;2yEnn$CTh&C>rHT&=lxf7P=#(#EPPciy^NpNpfm&fy6 zyHq@QWgN7Quua3{_deg{5xT!T;gZa`ORyevO_>{(A?_lqLBk?tVwv zcw05^>a_ok{2o4|X}ww9d&8OTI&1rWOV}o*G;4YIABj?U{IX!F^}2T#k9r-Lx43t4 zQ}MGEKFMrHSIIbi`NFw8qTYK#;l|L+6G_!~Ze99NeR6}~B({al`YhKLe)`LEQRrFT zI??kV7ys(_Gp;rdEi+?(kYl*_{)B`XhP%wqZ|jP#(p9}*eJ-*oDJ$~t`8iuYbpKr8 z6ERK5=7)pJsncv*Ui>=Sy+-oq%Zeq3{C<3p>{zWB-*@PMv~;_~ehIyzqM#1~lg%nO zR3z>d&q_N!SG9DT%34*A@h*@U6*qn zHy^6Hte@wl)-yqsiJ6gs5!rdbKw}2Ft9#bDh1-g6C9hApR-N{BU2-$a@;~dg7G7KQ zQJ(SQaf$cVkLJ}o)C&BrQ}J_}Sd^S!pj9u%vFqgL#g4H*SOanK#kCk$R#$8fp=e2%%0nLGWF^C(9e+@>P#BW zdNL$zHF&ktAn>}*$#cAlQ?j&eY5qOdbG-`=RZ1|_=kVfH7Wht?MK{y+;BacmesiaSi9C`rL(tv zt7e>A!hGn3)+w + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/integration/src/test/resources/keycloak-saml/missing-assertion-sig/WEB-INF/keystore.jks b/testsuite/integration/src/test/resources/keycloak-saml/missing-assertion-sig/WEB-INF/keystore.jks new file mode 100755 index 0000000000000000000000000000000000000000..144830bc77683d1d0a3d29f8793471d4f395bdb0 GIT binary patch literal 1705 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=N1M z7#KYz`B=UJb?!81V%loJ$Ht}2#>m2`#U#kc$jZRd#I(>@`_HHQr3*BE{x`hDyEHld z+K~ja7y5T|r=%}Fu;`1zi=v(re>&z=o_dkol)j+zYO>t=Qy1S}v3en%vP3563G;>m zf%$6H#y=LWo_E+v&g1u@xzTso16CaPbkO_D8o@;(`MobV^Igq3BNxZ5w|jA2W>>?O zsK)o5D^C2naN_4wlZOiFZx$ZYW2t4}JhWx=_GhgLGruICtx3+%d3V!9>Dt7nXAhlc z$;{X;mJr8N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oa z{d4O3!wr>pceY+y88$ipliuM2X9G4KozS*BUZS)4a=%Gc^OV}R*}*rh8m{{;m0Oa) z^Ysn?xlP?KeF94gT3Fr`zuJ}MUVH6cw8xR2&A~UG*V~pyDQR4_ymoT_iPrx=pDW$^ gV7obl)$b?cUQd>i8HM*{tk@@=IXfvlri|w}0JG8182|tP literal 0 HcmV?d00001 diff --git a/testsuite/integration/src/test/resources/keycloak-saml/sales-post-assertion-and-response-sig/WEB-INF/keycloak-saml.xml b/testsuite/integration/src/test/resources/keycloak-saml/sales-post-assertion-and-response-sig/WEB-INF/keycloak-saml.xml new file mode 100755 index 0000000000..1bd35d1856 --- /dev/null +++ b/testsuite/integration/src/test/resources/keycloak-saml/sales-post-assertion-and-response-sig/WEB-INF/keycloak-saml.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testsuite/integration/src/test/resources/keycloak-saml/sales-post-assertion-and-response-sig/WEB-INF/keystore.jks b/testsuite/integration/src/test/resources/keycloak-saml/sales-post-assertion-and-response-sig/WEB-INF/keystore.jks new file mode 100755 index 0000000000000000000000000000000000000000..144830bc77683d1d0a3d29f8793471d4f395bdb0 GIT binary patch literal 1705 zcmezO_TO6u1_mZ5W@J#!C@Cqh($~+)PfpCq$S*FjvM{hP&@WERNiEhb0P=N1M z7#KYz`B=UJb?!81V%loJ$Ht}2#>m2`#U#kc$jZRd#I(>@`_HHQr3*BE{x`hDyEHld z+K~ja7y5T|r=%}Fu;`1zi=v(re>&z=o_dkol)j+zYO>t=Qy1S}v3en%vP3563G;>m zf%$6H#y=LWo_E+v&g1u@xzTso16CaPbkO_D8o@;(`MobV^Igq3BNxZ5w|jA2W>>?O zsK)o5D^C2naN_4wlZOiFZx$ZYW2t4}JhWx=_GhgLGruICtx3+%d3V!9>Dt7nXAhlc z$;{X;mJr8NzU5%3ud}q*;Tc<&7_HRg&F#_Q?wWFKHOG|)@xdBe`K>+ek+V}K-){E) zl)cD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0Oa) z^Ysn?xlP?KeF94gT3Fr`zuJ}MUVH6cw8xR2&A~UG*V~pyDQR4_ymoT_iPrx=pDW$^ gV7obl)$b?cUQd>i8HM*{tk@@=IXfvlri|w}0JG8182|tP literal 0 HcmV?d00001 diff --git a/testsuite/integration/src/test/resources/keycloak-saml/testsaml.json b/testsuite/integration/src/test/resources/keycloak-saml/testsaml.json index 92ddf1a9af..b184a58bbc 100755 --- a/testsuite/integration/src/test/resources/keycloak-saml/testsaml.json +++ b/testsuite/integration/src/test/resources/keycloak-saml/testsaml.json @@ -158,6 +158,50 @@ "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" } }, + { + "name": "http://localhost:8081/sales-post-assertion-and-response-sig/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8081/sales-post-assertion-and-response-sig", + "redirectUris": [ + "http://localhost:8081/sales-post-assertion-and-response-sig/*" + ], + "attributes": { + "saml_assertion_consumer_url_post": "http://localhost:8081/sales-post-assertion-and-response-sig/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8081/sales-post-assertion-and-response-sig/saml", + "saml_single_logout_service_url_post": "http://localhost:8081/sales-post-assertion-and-response-sig/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8081/sales-post-assertion-and-response-sig/saml", + "saml.server.signature": "true", + "saml.assertion.signature": "true", + "saml.signature.algorithm": "RSA_SHA256", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, + { + "name": "http://localhost:8081/missing-assertion-sig/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8081/missing-assertion-sig", + "redirectUris": [ + "http://localhost:8081/missing-assertion-sig/*" + ], + "attributes": { + "saml_assertion_consumer_url_post": "http://localhost:8081/missing-assertion-sig/saml", + "saml_assertion_consumer_url_redirect": "http://localhost:8081/missing-assertion-sig/saml", + "saml_single_logout_service_url_post": "http://localhost:8081/missing-assertion-sig/saml", + "saml_single_logout_service_url_redirect": "http://localhost:8081/missing-assertion-sig/saml", + "saml.server.signature": "true", + "saml.assertion.signature": "false", + "saml.signature.algorithm": "RSA_SHA256", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, { "name": "http://localhost:8081/sales-post-sig-transient/", "enabled": true, @@ -242,6 +286,23 @@ "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" } }, + { + "name": "http://localhost:8081/bad-assertion-sales-post-sig/", + "enabled": true, + "protocol": "saml", + "fullScopeAllowed": true, + "baseUrl": "http://localhost:8081/bad-assertion-sales-post-sig/", + "adminUrl": "http://localhost:8081/bad-assertion-sales-post-sig/saml", + "redirectUris": [ + "http://localhost:8081/bad-assertion-sales-post-sig/*" + ], + "attributes": { + "saml.assertion.signature": "true", + "saml.client.signature": "true", + "saml.authnstatement": "true", + "saml.signing.certificate": "MIIB1DCCAT0CBgFJGP5dZDANBgkqhkiG9w0BAQsFADAwMS4wLAYDVQQDEyVodHRwOi8vbG9jYWxob3N0OjgwODAvc2FsZXMtcG9zdC1zaWcvMB4XDTE0MTAxNjEyNDQyM1oXDTI0MTAxNjEyNDYwM1owMDEuMCwGA1UEAxMlaHR0cDovL2xvY2FsaG9zdDo4MDgwL3NhbGVzLXBvc3Qtc2lnLzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1RvGu8RjemSJA23nnMksoHA37MqY1DDTxOECY4rPAd9egr7GUNIXE0y1MokaR5R2crNpN8RIRwR8phQtQDjXL82c6W+NLQISxztarQJ7rdNJIYwHY0d5ri1XRpDP8zAuxubPYiMAVYcDkIcvlbBpwh/dRM5I2eElRK+eSiaMkCUCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCLms6htnPaY69k1ntm9a5jgwSn/K61cdai8R8B0ccY7zvinn9AfRD7fiROQpFyY29wKn8WCLrJ86NBXfgFUGyR5nLNHVy3FghE36N2oHy53uichieMxffE6vhkKJ4P8ChfJMMOZlmCPsQPDvjoAghHt4mriFiQgRdPgIy/zDjSNw==" + } + }, { "name": "http://localhost:8081/bad-client-sales-post-sig/", "enabled": true, @@ -274,6 +335,7 @@ "saml_single_logout_service_url_post": "http://localhost:8081/sales-post-enc/saml", "saml_single_logout_service_url_redirect": "http://localhost:8081/sales-post-enc/saml", "saml.server.signature": "true", + "saml.assertion.signature": "true", "saml.signature.algorithm": "RSA_SHA512", "saml.client.signature": "true", "saml.encrypt": "true",