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;
}
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));
}
Aggregations