Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class SamlDescriptorIDPKeysExtractor {
private static final NamespaceContext NS_CONTEXT = new NamespaceContext();
static {
NS_CONTEXT.addNsUriPair("m", JBossSAMLURIConstants.METADATA_NSURI.get());
NS_CONTEXT.addNsUriPair("dsig", JBossSAMLURIConstants.XMLDSIG_NSURI.get());
NS_CONTEXT.addNsUriPair("ds", JBossSAMLURIConstants.XMLDSIG_NSURI.get());
}

private final KeyInfoFactory kif = KeyInfoFactory.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ public static KeyValueType createKeyValue(PublicKey key) {
private static void signImpl(DOMSignContext dsc, String digestMethod, String signatureMethod, String referenceURI, String keyName, PublicKey publicKey,
X509Certificate x509Certificate, String canonicalizationMethodType)
throws GeneralSecurityException, MarshalException, XMLSignatureException {
dsc.setDefaultNamespacePrefix("dsig");
dsc.setDefaultNamespacePrefix(WSTrustConstants.XMLDSig.DSIG_PREFIX);

DigestMethod digestMethodObj = fac.newDigestMethod(digestMethod, null);
Transform transform1 = fac.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public Map<String, String> parseConfig(KeycloakSession session, String config) {
if (keyDescriptor != null) {
for (KeyDescriptorType keyDescriptorType : keyDescriptor) {
Element keyInfo = keyDescriptorType.getKeyInfo();
Element x509KeyInfo = DocumentUtil.getChildElement(keyInfo, new QName("dsig", "X509Certificate"));
Element x509KeyInfo = DocumentUtil.getChildElement(keyInfo, new QName(JBossSAMLURIConstants.XMLDSIG_NSURI.get(), "X509Certificate", "ds"));

if (KeyTypes.SIGNING.equals(keyDescriptorType.getUse())) {
samlIdentityProviderConfig.addSigningCertificate(x509KeyInfo.getTextContent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ public void testEmptyKeyInfoElement() {

log.debug("Removing KeyInfo from Keycloak response");
Document responseDoc = documentHolder.getSamlDocument();
IOUtil.removeElementFromDoc(responseDoc, "samlp:Response/dsig:Signature/dsig:KeyInfo");
IOUtil.removeElementFromDoc(responseDoc, "samlp:Response/ds:Signature/ds:KeyInfo");

CloseableHttpResponse response = null;
try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public void testSignatureContainsAllowedCharactersOnly() throws IOException {
.getSamlResponse(Binding.POST);

final String signature = documentHolder.getSamlDocument()
.getElementsByTagName("dsig:SignatureValue")
.getElementsByTagName("ds:SignatureValue")
.item(0).getTextContent();
Comment on lines +346 to 347

// Corresponds to https://www.w3.org/TR/xmlschema-2/#base64Binary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void rejectedConsentResponseTest() throws ParsingException, Configuration
.getSamlResponse(Binding.POST);

final String samlDocumentString = IOUtil.documentToString(documentHolder.getSamlDocument());
assertThat(samlDocumentString, containsString("<dsig:Signature")); // KEYCLOAK-4262
assertThat(samlDocumentString, containsString("<ds:Signature")); // KEYCLOAK-4262
assertThat(samlDocumentString, not(containsString("<samlp:LogoutResponse"))); // KEYCLOAK-4261
assertThat(samlDocumentString, containsString("<samlp:Response")); // KEYCLOAK-4261
assertThat(samlDocumentString, containsString("<samlp:Status")); // KEYCLOAK-4181
Expand Down