Search in sources :

Example 1 with MapAuthenticationFlowEntity

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

the class MapRealmAdapter method addAuthenticationFlow.

@Override
public AuthenticationFlowModel addAuthenticationFlow(AuthenticationFlowModel model) {
    if (entity.getAuthenticationFlow(model.getId()).isPresent()) {
        throw new ModelDuplicateException("An AuthenticationFlow with given id already exists");
    }
    MapAuthenticationFlowEntity authenticationFlowEntity = MapAuthenticationFlowEntity.fromModel(model);
    entity.addAuthenticationFlow(authenticationFlowEntity);
    return MapAuthenticationFlowEntity.toModel(authenticationFlowEntity);
}
Also used : MapAuthenticationFlowEntity(org.keycloak.models.map.realm.entity.MapAuthenticationFlowEntity) ModelDuplicateException(org.keycloak.models.ModelDuplicateException)

Aggregations

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