Merge pull request #3318 from mhajas/KEYCLOAK-3654
KEYCLOAK-3654 Fix jwks-url in integration-arquillian
This commit is contained in:
commit
90097e9aea
1 changed files with 11 additions and 0 deletions
|
@ -70,6 +70,7 @@ public abstract class AbstractAdapterTest extends AbstractAuthTest {
|
|||
modifyClientUrls(tr, "^(/.*)", appServerContextRootPage.toString() + "$1");
|
||||
modifySamlMasterURLs(tr, "8080", System.getProperty("auth.server.http.port", null));
|
||||
modifySAMLClientsAttributes(tr, "8080", System.getProperty("app.server.http.port", "8280"));
|
||||
modifyClientJWKSUrl(tr, "^(/.*)", appServerContextRootPage.toString() + "$1");
|
||||
}
|
||||
if ("true".equals(System.getProperty("auth.server.ssl.required"))) {
|
||||
tr.setSslRequired("all");
|
||||
|
@ -77,6 +78,16 @@ public abstract class AbstractAdapterTest extends AbstractAuthTest {
|
|||
}
|
||||
}
|
||||
|
||||
private void modifyClientJWKSUrl(RealmRepresentation realm, String regex, String replacement) {
|
||||
if (realm.getClients() != null) {
|
||||
realm.getClients().stream().filter(client -> "client-jwt".equals(client.getClientAuthenticatorType())).forEach(client -> {
|
||||
Map<String, String> attr = client.getAttributes();
|
||||
attr.put("jwks.url", attr.get("jwks.url").replaceFirst(regex, replacement));
|
||||
client.setAttributes(attr);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void addAdapterTestRealms(List<RealmRepresentation> testRealms);
|
||||
|
||||
public boolean isRelative() {
|
||||
|
|
Loading…
Reference in a new issue