Search in sources :

Example 1 with RequiredCredentialModel

use of org.keycloak.models.RequiredCredentialModel in project keycloak by keycloak.

the class MapRequiredCredentialEntity method toModel.

static RequiredCredentialModel toModel(MapRequiredCredentialEntity entity) {
    if (entity == null)
        return null;
    RequiredCredentialModel model = new RequiredCredentialModel();
    model.setFormLabel(entity.getFormLabel());
    model.setType(entity.getType());
    Boolean secret = entity.isSecret();
    model.setSecret(secret == null ? false : secret);
    Boolean input = entity.isInput();
    model.setInput(input == null ? false : input);
    return model;
}
Also used : RequiredCredentialModel(org.keycloak.models.RequiredCredentialModel)

Example 2 with RequiredCredentialModel

use of org.keycloak.models.RequiredCredentialModel in project keycloak by keycloak.

the class MapRealmAdapter method addRequiredCredential.

@Override
public void addRequiredCredential(String cred) {
    RequiredCredentialModel model = RequiredCredentialModel.BUILT_IN.get(cred);
    if (model == null) {
        throw new RuntimeException("Unknown credential type " + cred);
    }
    entity.addRequiredCredential(MapRequiredCredentialEntity.fromModel(model));
}
Also used : RequiredCredentialModel(org.keycloak.models.RequiredCredentialModel)

Aggregations

RequiredCredentialModel (org.keycloak.models.RequiredCredentialModel)2