Search in sources :

Example 1 with MapIdentityProviderMapperEntity

use of org.keycloak.models.map.realm.entity.MapIdentityProviderMapperEntity in project keycloak by keycloak.

the class MapRealmAdapter method addIdentityProviderMapper.

@Override
public IdentityProviderMapperModel addIdentityProviderMapper(IdentityProviderMapperModel model) {
    MapIdentityProviderMapperEntity identityProviderMapper = MapIdentityProviderMapperEntity.fromModel(model);
    if (entity.getIdentityProviderMapper(model.getId()).isPresent()) {
        throw new ModelDuplicateException("An IdentityProviderMapper with given id already exists");
    }
    entity.addIdentityProviderMapper(identityProviderMapper);
    return MapIdentityProviderMapperEntity.toModel(identityProviderMapper);
}
Also used : ModelDuplicateException(org.keycloak.models.ModelDuplicateException) MapIdentityProviderMapperEntity(org.keycloak.models.map.realm.entity.MapIdentityProviderMapperEntity)

Aggregations

ModelDuplicateException (org.keycloak.models.ModelDuplicateException)1 MapIdentityProviderMapperEntity (org.keycloak.models.map.realm.entity.MapIdentityProviderMapperEntity)1