Skip to content
Merged
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 @@ -521,9 +521,9 @@ public void configureTestRealm(RealmRepresentation testRealm) {
testRealm.getComponents().add("org.keycloak.keys.KeyProvider", getKeyProvider());

testRealm.getComponents().add("org.keycloak.keys.KeyProvider",
getRsaEncKeyProvider(RSA_OAEP_256, "enc-key-oaep256"));
getRsaEncKeyProvider(RSA_OAEP_256, "enc-key-oaep256", 100));
testRealm.getComponents().add("org.keycloak.keys.KeyProvider",
getRsaEncKeyProvider(RSA_OAEP, "enc-key-oaep"));
getRsaEncKeyProvider(RSA_OAEP, "enc-key-oaep", 101));

// Find existing client representation
ClientRepresentation existingClient = testRealm.getClients().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ public void configureTestRealm(RealmRepresentation testRealm) {
}

testRealm.getComponents().add("org.keycloak.keys.KeyProvider",
getRsaEncKeyProvider(RSA_OAEP_256, "enc-key-oaep256"));
getRsaEncKeyProvider(RSA_OAEP_256, "enc-key-oaep256", 100));
testRealm.getComponents().add("org.keycloak.keys.KeyProvider",
getRsaEncKeyProvider(RSA_OAEP, "enc-key-oaep"));
getRsaEncKeyProvider(RSA_OAEP, "enc-key-oaep", 101));

super.configureTestRealm(testRealm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static ComponentExportRepresentation getRsaKeyProvider(KeyWrapper keyWrap
return componentExportRepresentation;
}

public static ComponentExportRepresentation getRsaEncKeyProvider(String algorithm, String keyName) {
public static ComponentExportRepresentation getRsaEncKeyProvider(String algorithm, String keyName, int priority) {
KeyWrapper keyWrapper = getRsaKey(KeyUse.ENC, algorithm, keyName);
ComponentExportRepresentation componentExportRepresentation = new ComponentExportRepresentation();
componentExportRepresentation.setName(keyName);
Expand All @@ -237,7 +237,7 @@ public static ComponentExportRepresentation getRsaEncKeyProvider(String algorith
"privateKey", List.of(PemUtils.encodeKey(keyWrapper.getPrivateKey())),
"certificate", List.of(PemUtils.encodeCertificate(certificate)),
"active", List.of("true"),
"priority", List.of("100"),
"priority", List.of(String.valueOf(priority)),
"enabled", List.of("true"),
"algorithm", List.of(algorithm),
"keyUse", List.of(KeyUse.ENC.name())
Expand Down