use of org.keycloak.provider.ProviderConfigProperty in project keycloak by keycloak.
the class AbstractLDAPStorageMapperFactory method createConfigProperty.
public static ProviderConfigProperty createConfigProperty(String name, String label, String helpText, String type, List<String> options) {
ProviderConfigProperty configProperty = new ProviderConfigProperty();
configProperty.setName(name);
configProperty.setLabel(label);
configProperty.setHelpText(helpText);
configProperty.setType(type);
configProperty.setOptions(options);
return configProperty;
}
use of org.keycloak.provider.ProviderConfigProperty in project keycloak by keycloak.
the class CertificateLDAPStorageMapperFactory method getCertificateConfigProperties.
private static List<ProviderConfigProperty> getCertificateConfigProperties(ComponentModel p) {
List<ProviderConfigProperty> configProps = new ArrayList<>(getConfigProps(null));
ProviderConfigurationBuilder config = ProviderConfigurationBuilder.create().property().name(CertificateLDAPStorageMapper.IS_DER_FORMATTED).label("DER Formatted").helpText("Activate this if the certificate is DER formatted in LDAP and not PEM formatted.").type(ProviderConfigProperty.BOOLEAN_TYPE).add();
configProps.addAll(config.build());
return configProps;
}
use of org.keycloak.provider.ProviderConfigProperty in project keycloak by keycloak.
the class ComponentResource method toComponentTypeRepresentation.
private ComponentTypeRepresentation toComponentTypeRepresentation(ProviderFactory factory, ComponentModel parent) {
ComponentTypeRepresentation rep = new ComponentTypeRepresentation();
rep.setId(factory.getId());
ComponentFactory componentFactory = (ComponentFactory) factory;
rep.setHelpText(componentFactory.getHelpText());
List<ProviderConfigProperty> props;
Map<String, Object> metadata;
if (factory instanceof SubComponentFactory) {
props = ((SubComponentFactory) factory).getConfigProperties(realm, parent);
metadata = ((SubComponentFactory) factory).getTypeMetadata(realm, parent);
} else {
props = componentFactory.getConfigProperties();
metadata = componentFactory.getTypeMetadata();
}
List<ConfigPropertyRepresentation> propReps = ModelToRepresentation.toRepresentation(props);
rep.setProperties(propReps);
rep.setMetadata(metadata);
return rep;
}
use of org.keycloak.provider.ProviderConfigProperty in project keycloak by keycloak.
the class AuthenticationManagementResource method getAuthenticatorConfigDescription.
/**
* Get authenticator provider's configuration description
*/
@Path("config-description/{providerId}")
@GET
@Produces(MediaType.APPLICATION_JSON)
@NoCache
public AuthenticatorConfigInfoRepresentation getAuthenticatorConfigDescription(@PathParam("providerId") String providerId) {
auth.realm().requireViewRealm();
ConfigurableAuthenticatorFactory factory = CredentialHelper.getConfigurableAuthenticatorFactory(session, providerId);
if (factory == null) {
throw new NotFoundException("Could not find authenticator provider");
}
AuthenticatorConfigInfoRepresentation rep = new AuthenticatorConfigInfoRepresentation();
rep.setProviderId(providerId);
rep.setName(factory.getDisplayType());
rep.setHelpText(factory.getHelpText());
rep.setProperties(new LinkedList<>());
List<ProviderConfigProperty> configProperties = Optional.ofNullable(factory.getConfigProperties()).orElse(Collections.emptyList());
for (ProviderConfigProperty prop : configProperties) {
ConfigPropertyRepresentation propRep = getConfigPropertyRep(prop);
rep.getProperties().add(propRep);
}
return rep;
}
use of org.keycloak.provider.ProviderConfigProperty in project keycloak by keycloak.
the class OIDCAttributeMapperHelper method addTokenClaimNameConfig.
public static void addTokenClaimNameConfig(List<ProviderConfigProperty> configProperties) {
ProviderConfigProperty property = new ProviderConfigProperty();
property.setName(TOKEN_CLAIM_NAME);
property.setLabel(TOKEN_CLAIM_NAME_LABEL);
property.setType(ProviderConfigProperty.STRING_TYPE);
property.setHelpText(TOKEN_CLAIM_NAME_TOOLTIP);
configProperties.add(property);
}
Aggregations