Search in sources :

Example 6 with RoleLDAPStorageMapper

use of org.keycloak.storage.ldap.mappers.membership.role.RoleLDAPStorageMapper in project keycloak by keycloak.

the class LDAPTestUtils method syncRolesFromLDAP.

// End CRUD model mappers
public static void syncRolesFromLDAP(RealmModel realm, LDAPStorageProvider ldapProvider, ComponentModel providerModel) {
    ComponentModel mapperModel = getSubcomponentByName(realm, providerModel, "realmRolesMapper");
    RoleLDAPStorageMapper roleMapper = getRoleMapper(mapperModel, ldapProvider, realm);
    roleMapper.syncDataFromFederationProviderToKeycloak(realm);
    mapperModel = getSubcomponentByName(realm, providerModel, "financeRolesMapper");
    roleMapper = getRoleMapper(mapperModel, ldapProvider, realm);
    roleMapper.syncDataFromFederationProviderToKeycloak(realm);
}
Also used : ComponentModel(org.keycloak.component.ComponentModel) RoleLDAPStorageMapper(org.keycloak.storage.ldap.mappers.membership.role.RoleLDAPStorageMapper)

Aggregations

ComponentModel (org.keycloak.component.ComponentModel)6 RoleLDAPStorageMapper (org.keycloak.storage.ldap.mappers.membership.role.RoleLDAPStorageMapper)6 Test (org.junit.Test)5 RealmModel (org.keycloak.models.RealmModel)5 RoleModel (org.keycloak.models.RoleModel)5 UserModel (org.keycloak.models.UserModel)5 LDAPObject (org.keycloak.storage.ldap.idm.model.LDAPObject)5 LDAPStorageProvider (org.keycloak.storage.ldap.LDAPStorageProvider)4 ModelException (org.keycloak.models.ModelException)1 ComponentRepresentation (org.keycloak.representations.idm.ComponentRepresentation)1 UserStorageSyncManager (org.keycloak.services.managers.UserStorageSyncManager)1 UserStorageProviderModel (org.keycloak.storage.UserStorageProviderModel)1 SynchronizationResult (org.keycloak.storage.user.SynchronizationResult)1 AbstractLDAPTest (org.keycloak.testsuite.federation.ldap.AbstractLDAPTest)1 LDAPTestContext (org.keycloak.testsuite.federation.ldap.LDAPTestContext)1