Fix AdminApiTest. Fix distribution. Try to prevent InMemoryModel leaks.
This commit is contained in:
parent
e0f670768f
commit
b1d341155d
17 changed files with 100 additions and 19 deletions
|
@ -254,6 +254,11 @@
|
||||||
<maven-resource group="org.keycloak" artifact="keycloak-saml-protocol"/>
|
<maven-resource group="org.keycloak" artifact="keycloak-saml-protocol"/>
|
||||||
</module-def>
|
</module-def>
|
||||||
|
|
||||||
|
<!-- file -->
|
||||||
|
<module-def name="org.keycloak.keycloak-model-file">
|
||||||
|
<maven-resource group="org.keycloak" artifact="keycloak-model-file"/>
|
||||||
|
</module-def>
|
||||||
|
|
||||||
<!-- mongo -->
|
<!-- mongo -->
|
||||||
|
|
||||||
<module-def name="org.keycloak.keycloak-connections-mongo">
|
<module-def name="org.keycloak.keycloak-connections-mongo">
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<module xmlns="urn:jboss:module:1.1" name="org.keycloak.keycloak-model-file">
|
||||||
|
<resources>
|
||||||
|
<resource-root path="keycloak-model-file-1.2.0.Beta1-SNAPSHOT.jar"/>
|
||||||
|
<!-- Insert resources here -->
|
||||||
|
</resources>
|
||||||
|
<dependencies>
|
||||||
|
<module name="org.keycloak.keycloak-core"/>
|
||||||
|
<module name="org.keycloak.keycloak-model-api"/>
|
||||||
|
<module name="org.keycloak.keycloak-export-import-api"/>
|
||||||
|
<module name="org.keycloak.keycloak-export-import-single-file"/>
|
||||||
|
<module name="org.codehaus.jackson.jackson-mapper-asl"/>
|
||||||
|
<module name="org.jboss.logging"/>
|
||||||
|
<module name="javax.api"/>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</module>
|
|
@ -42,6 +42,7 @@
|
||||||
<module name="org.keycloak.keycloak-model-api" services="import"/>
|
<module name="org.keycloak.keycloak-model-api" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-jpa" services="import"/>
|
<module name="org.keycloak.keycloak-model-jpa" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-mongo" services="import"/>
|
<module name="org.keycloak.keycloak-model-mongo" services="import"/>
|
||||||
|
<module name="org.keycloak.keycloak-model-file" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-sessions-infinispan" services="import"/>
|
<module name="org.keycloak.keycloak-model-sessions-infinispan" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-sessions-jpa" services="import"/>
|
<module name="org.keycloak.keycloak-model-sessions-jpa" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-sessions-mem" services="import"/>
|
<module name="org.keycloak.keycloak-model-sessions-mem" services="import"/>
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
<module name="org.keycloak.keycloak-model-api" services="import"/>
|
<module name="org.keycloak.keycloak-model-api" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-jpa" services="import"/>
|
<module name="org.keycloak.keycloak-model-jpa" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-mongo" services="import"/>
|
<module name="org.keycloak.keycloak-model-mongo" services="import"/>
|
||||||
|
<module name="org.keycloak.keycloak-model-file" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-sessions-infinispan" services="import"/>
|
<module name="org.keycloak.keycloak-model-sessions-infinispan" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-sessions-jpa" services="import"/>
|
<module name="org.keycloak.keycloak-model-sessions-jpa" services="import"/>
|
||||||
<module name="org.keycloak.keycloak-model-sessions-mem" services="import"/>
|
<module name="org.keycloak.keycloak-model-sessions-mem" services="import"/>
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class FileRealmProvider implements RealmProvider {
|
||||||
|
|
||||||
public FileRealmProvider(KeycloakSession session, InMemoryModel inMemoryModel) {
|
public FileRealmProvider(KeycloakSession session, InMemoryModel inMemoryModel) {
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
session.enlistForClose(this);
|
||||||
this.inMemoryModel = inMemoryModel;
|
this.inMemoryModel = inMemoryModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +87,7 @@ public class FileRealmProvider implements RealmProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
inMemoryModel.sessionClosed(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -53,11 +53,13 @@ public class FileUserProvider implements UserProvider {
|
||||||
|
|
||||||
public FileUserProvider(KeycloakSession session, InMemoryModel inMemoryModel) {
|
public FileUserProvider(KeycloakSession session, InMemoryModel inMemoryModel) {
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
session.enlistForClose(this);
|
||||||
this.inMemoryModel = inMemoryModel;
|
this.inMemoryModel = inMemoryModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
inMemoryModel.sessionClosed(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -219,8 +221,7 @@ public class FileUserProvider implements UserProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<FederatedIdentityModel> getFederatedIdentities(UserModel userModel, RealmModel realm) {
|
public Set<FederatedIdentityModel> getFederatedIdentities(UserModel userModel, RealmModel realm) {
|
||||||
UserModel user = getUserById(userModel.getId(), realm);
|
UserEntity userEntity = ((UserAdapter) userModel).getUserEntity();
|
||||||
UserEntity userEntity = ((UserAdapter) user).getUserEntity();
|
|
||||||
List<FederatedIdentityEntity> linkEntities = userEntity.getFederatedIdentities();
|
List<FederatedIdentityEntity> linkEntities = userEntity.getFederatedIdentities();
|
||||||
|
|
||||||
if (linkEntities == null) {
|
if (linkEntities == null) {
|
||||||
|
@ -391,12 +392,31 @@ public class FileUserProvider implements UserProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateFederatedIdentity(RealmModel realm, UserModel federatedUser, FederatedIdentityModel federatedIdentityModel) {
|
public void updateFederatedIdentity(RealmModel realm, UserModel federatedUser, FederatedIdentityModel federatedIdentityModel) {
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
federatedUser = getUserById(federatedUser.getId(), realm);
|
||||||
|
UserEntity userEntity = ((UserAdapter) federatedUser).getUserEntity();
|
||||||
|
FederatedIdentityEntity federatedIdentityEntity = findFederatedIdentityLink(userEntity, federatedIdentityModel.getIdentityProvider());
|
||||||
|
|
||||||
|
federatedIdentityEntity.setToken(federatedIdentityModel.getToken());
|
||||||
|
}
|
||||||
|
|
||||||
|
private FederatedIdentityEntity findFederatedIdentityLink(UserEntity userEntity, String identityProvider) {
|
||||||
|
List<FederatedIdentityEntity> linkEntities = userEntity.getFederatedIdentities();
|
||||||
|
if (linkEntities == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (FederatedIdentityEntity federatedIdentityEntity : linkEntities) {
|
||||||
|
if (federatedIdentityEntity.getIdentityProvider().equals(identityProvider)) {
|
||||||
|
return federatedIdentityEntity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CredentialValidationOutput validCredentials(RealmModel realm, UserCredentialModel... input) {
|
public CredentialValidationOutput validCredentials(RealmModel realm, UserCredentialModel... input) {
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
|
return null; // not supported yet
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,8 @@ import org.keycloak.util.JsonSerialization;
|
||||||
/**
|
/**
|
||||||
* This class provides an in-memory copy of the entire model for each
|
* This class provides an in-memory copy of the entire model for each
|
||||||
* Keycloak session. At the start of the session, the model is read
|
* Keycloak session. At the start of the session, the model is read
|
||||||
* from JSON. When the session's transaction ends, the model is written.
|
* from JSON. When the session's transaction ends, the model is written back
|
||||||
|
* out.
|
||||||
*
|
*
|
||||||
* @author Stan Silvert ssilvert@redhat.com (C) 2015 Red Hat Inc.
|
* @author Stan Silvert ssilvert@redhat.com (C) 2015 Red Hat Inc.
|
||||||
*/
|
*/
|
||||||
|
@ -83,6 +84,7 @@ public class InMemoryModel implements KeycloakTransaction {
|
||||||
allModels.put(session, model);
|
allModels.put(session, model);
|
||||||
session.getTransaction().enlist(model);
|
session.getTransaction().enlist(model);
|
||||||
model.readModelFile();
|
model.readModelFile();
|
||||||
|
logger.info("Added session " + session.hashCode() + " total sessions=" + allModels.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
|
@ -104,6 +106,7 @@ public class InMemoryModel implements KeycloakTransaction {
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
logger.error("Unable to read model file " + kcdata.getAbsolutePath(), ioe);
|
logger.error("Unable to read model file " + kcdata.getAbsolutePath(), ioe);
|
||||||
} finally {
|
} finally {
|
||||||
|
logger.info("Read model file for session=" + session.hashCode());
|
||||||
try {
|
try {
|
||||||
if (fis != null) fis.close();
|
if (fis != null) fis.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -121,6 +124,7 @@ public class InMemoryModel implements KeycloakTransaction {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("Unable to write model file " + keycloakModelFile.getAbsolutePath(), e);
|
logger.error("Unable to write model file " + keycloakModelFile.getAbsolutePath(), e);
|
||||||
} finally {
|
} finally {
|
||||||
|
logger.info("Wrote model file for session=" + session.hashCode());
|
||||||
try {
|
try {
|
||||||
if (outStream != null) outStream.close();
|
if (outStream != null) outStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -195,17 +199,25 @@ public class InMemoryModel implements KeycloakTransaction {
|
||||||
return (realmUsers(realmId).remove(userId) != null);
|
return (realmUsers(realmId).remove(userId) != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sessionClosed(KeycloakSession session) {
|
||||||
|
synchronized (allModels) {
|
||||||
|
allModels.remove(session);
|
||||||
|
logger.info("Removed session " + session.hashCode());
|
||||||
|
logger.info("sessionClosed: Session count=" + allModels.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void begin() {
|
public void begin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// commitCount is used for debugging. This allows you to easily run a test
|
// commitCount is used for debugging. This allows you to easily run a test
|
||||||
// to a particular point and then examine the JSON file.
|
// to a particular point and then examine the JSON file.
|
||||||
// private static int commitCount = 0;
|
private static int commitCount = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void commit() {
|
public void commit() {
|
||||||
// commitCount++;
|
commitCount++;
|
||||||
synchronized (allModels) {
|
synchronized (allModels) {
|
||||||
// in case commit was somehow called twice on the same session
|
// in case commit was somehow called twice on the same session
|
||||||
if (!allModels.containsKey(session)) return;
|
if (!allModels.containsKey(session)) return;
|
||||||
|
@ -214,10 +226,12 @@ public class InMemoryModel implements KeycloakTransaction {
|
||||||
writeModelFile();
|
writeModelFile();
|
||||||
} finally {
|
} finally {
|
||||||
allModels.remove(session);
|
allModels.remove(session);
|
||||||
// System.out.println("*** commitCount=" + commitCount);
|
logger.info("Removed session " + session.hashCode());
|
||||||
|
logger.info("*** commitCount=" + commitCount);
|
||||||
|
logger.info("commit(): Session count=" + allModels.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (commitCount == 61) System.exit(0);
|
// if (commitCount == 16) {Thread.dumpStack();System.exit(0);}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,6 +239,7 @@ public class InMemoryModel implements KeycloakTransaction {
|
||||||
public void rollback() {
|
public void rollback() {
|
||||||
synchronized (allModels) {
|
synchronized (allModels) {
|
||||||
allModels.remove(session);
|
allModels.remove(session);
|
||||||
|
System.out.println("rollback(): Session count=" + allModels.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ public class ApplicationAdapter extends ClientAdapter implements ApplicationMode
|
||||||
|
|
||||||
private boolean appNameExists(String name) {
|
private boolean appNameExists(String name) {
|
||||||
for (ApplicationModel app : realm.getApplications()) {
|
for (ApplicationModel app : realm.getApplications()) {
|
||||||
|
if (app == this) continue;
|
||||||
if (app.getName().equals(name)) return true;
|
if (app.getName().equals(name)) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1033,7 +1033,7 @@ public class RealmAdapter implements RealmModel {
|
||||||
@Override
|
@Override
|
||||||
public boolean isIdentityFederationEnabled() {
|
public boolean isIdentityFederationEnabled() {
|
||||||
//TODO: not sure if we will support identity federation storage for file
|
//TODO: not sure if we will support identity federation storage for file
|
||||||
return true;
|
return getIdentityProviders() != null && !getIdentityProviders().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -73,6 +73,7 @@ public class RoleAdapter implements RoleModel {
|
||||||
@Override
|
@Override
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
RealmAdapter realmAdapter = (RealmAdapter)realm;
|
RealmAdapter realmAdapter = (RealmAdapter)realm;
|
||||||
|
if (role.getName().equals(name)) return;
|
||||||
if (realmAdapter.hasRoleWithName(name)) throw new ModelDuplicateException("Role name " + name + " already exists.");
|
if (realmAdapter.hasRoleWithName(name)) throw new ModelDuplicateException("Role name " + name + " already exists.");
|
||||||
role.setName(name);
|
role.setName(name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,7 +406,6 @@
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>**/AdminAPITest.java</exclude>
|
|
||||||
<exclude>**/ExportImportTest.java</exclude>
|
<exclude>**/ExportImportTest.java</exclude>
|
||||||
<exclude>**/SyncProvidersTest.java</exclude>
|
<exclude>**/SyncProvidersTest.java</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"realm": {
|
"realm": {
|
||||||
"provider": "${keycloak.realm.provider:file}",
|
"provider": "${keycloak.realm.provider:jpa}",
|
||||||
"file" : {
|
"file" : {
|
||||||
"directory" : ".",
|
"directory" : ".",
|
||||||
"fileName" : "kcdata.json"
|
"fileName" : "kcdata.json"
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"user": {
|
"user": {
|
||||||
"provider": "${keycloak.user.provider:file}"
|
"provider": "${keycloak.user.provider:jpa}"
|
||||||
},
|
},
|
||||||
|
|
||||||
"userSessions": {
|
"userSessions": {
|
||||||
|
|
|
@ -24,6 +24,8 @@ import org.keycloak.testsuite.broker.util.UserSessionStatusServlet;
|
||||||
import org.keycloak.testsuite.rule.AbstractKeycloakRule;
|
import org.keycloak.testsuite.rule.AbstractKeycloakRule;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import org.keycloak.representations.idm.RealmRepresentation;
|
||||||
|
import org.keycloak.testutils.KeycloakServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author pedroigor
|
* @author pedroigor
|
||||||
|
@ -32,7 +34,9 @@ public class BrokerKeyCloakRule extends AbstractKeycloakRule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
||||||
server.importRealm(getClass().getResourceAsStream("/broker-test/test-realm-with-broker.json"));
|
//server.importRealm(getClass().getResourceAsStream("/broker-test/test-realm-with-broker.json"));
|
||||||
|
RealmRepresentation realmWithBroker = KeycloakServer.loadJson(getClass().getResourceAsStream("/broker-test/test-realm-with-broker.json"), RealmRepresentation.class);
|
||||||
|
manager.importRealm(realmWithBroker);
|
||||||
URL url = getClass().getResource("/broker-test/test-app-keycloak.json");
|
URL url = getClass().getResource("/broker-test/test-app-keycloak.json");
|
||||||
deployApplication("test-app", "/test-app", UserSessionStatusServlet.class, url.getPath(), "manager");
|
deployApplication("test-app", "/test-app", UserSessionStatusServlet.class, url.getPath(), "manager");
|
||||||
deployApplication("test-app-allowed-providers", "/test-app-allowed-providers", UserSessionStatusServlet.class, url.getPath(), "manager");
|
deployApplication("test-app-allowed-providers", "/test-app-allowed-providers", UserSessionStatusServlet.class, url.getPath(), "manager");
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.openqa.selenium.WebDriver;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import org.keycloak.representations.idm.RealmRepresentation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author pedroigor
|
* @author pedroigor
|
||||||
|
@ -36,7 +37,9 @@ public class IdentityProviderHintTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
||||||
server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-kc-oidc.json"));
|
//server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-kc-oidc.json"));
|
||||||
|
RealmRepresentation realmWithOIDC = KeycloakServer.loadJson(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-kc-oidc.json"), RealmRepresentation.class);
|
||||||
|
manager.importRealm(realmWithOIDC);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
import org.keycloak.representations.idm.RealmRepresentation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author pedroigor
|
* @author pedroigor
|
||||||
|
@ -31,7 +32,9 @@ public class OIDCKeyCloakServerBrokerBasicTest extends AbstractIdentityProviderT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
||||||
server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-kc-oidc.json"));
|
//server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-kc-oidc.json"));
|
||||||
|
RealmRepresentation realmWithOIDC = KeycloakServer.loadJson(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-kc-oidc.json"), RealmRepresentation.class);
|
||||||
|
manager.importRealm(realmWithOIDC);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
import org.keycloak.representations.idm.RealmRepresentation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author pedroigor
|
* @author pedroigor
|
||||||
|
@ -35,7 +36,9 @@ public class SAMLKeyCloakServerBrokerBasicTest extends AbstractIdentityProviderT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
||||||
server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-saml.json"));
|
//server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-saml.json"));
|
||||||
|
RealmRepresentation realmWithSAML = KeycloakServer.loadJson(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-saml.json"), RealmRepresentation.class);
|
||||||
|
manager.importRealm(realmWithSAML);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
import org.keycloak.representations.idm.RealmRepresentation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author pedroigor
|
* @author pedroigor
|
||||||
|
@ -35,7 +36,9 @@ public class SAMLKeyCloakServerBrokerWithSignatureTest extends AbstractIdentityP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
protected void configure(KeycloakSession session, RealmManager manager, RealmModel adminRealm) {
|
||||||
server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-saml-with-signature.json"));
|
//server.importRealm(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-saml-with-signature.json"));
|
||||||
|
RealmRepresentation realmWithOIDC = KeycloakServer.loadJson(getClass().getResourceAsStream("/broker-test/test-broker-realm-with-saml-with-signature.json"), RealmRepresentation.class);
|
||||||
|
manager.importRealm(realmWithOIDC);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue