public static void setupIDM(String realmJson) throws Exception
{
idm = new InfinispanIDM(getDefaultCache());
RealmFactory factory = new RealmFactory(idm);
deployment.getProviderFactory().register(new SkeletonKeyContextResolver(true));
deployment.getRegistry().addSingletonResource(factory);
TokenManagement tokenManagement = new TokenManagement(idm);
deployment.getRegistry().addSingletonResource(tokenManagement);
RealmRepresentation r = loadJson(realmJson);