Search in sources :

Example 16 with ProviderConfigProperty

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;
}
Also used : ProviderConfigProperty(org.keycloak.provider.ProviderConfigProperty)

Example 17 with ProviderConfigProperty

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;
}
Also used : ProviderConfigurationBuilder(org.keycloak.provider.ProviderConfigurationBuilder) ProviderConfigProperty(org.keycloak.provider.ProviderConfigProperty) ArrayList(java.util.ArrayList)

Example 18 with ProviderConfigProperty

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;
}
Also used : ComponentTypeRepresentation(org.keycloak.representations.idm.ComponentTypeRepresentation) SubComponentFactory(org.keycloak.component.SubComponentFactory) SubComponentFactory(org.keycloak.component.SubComponentFactory) ComponentFactory(org.keycloak.component.ComponentFactory) ProviderConfigProperty(org.keycloak.provider.ProviderConfigProperty) ConfigPropertyRepresentation(org.keycloak.representations.idm.ConfigPropertyRepresentation)

Example 19 with ProviderConfigProperty

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;
}
Also used : AuthenticatorConfigInfoRepresentation(org.keycloak.representations.idm.AuthenticatorConfigInfoRepresentation) ProviderConfigProperty(org.keycloak.provider.ProviderConfigProperty) ConfigurableAuthenticatorFactory(org.keycloak.authentication.ConfigurableAuthenticatorFactory) NotFoundException(javax.ws.rs.NotFoundException) ConfigPropertyRepresentation(org.keycloak.representations.idm.ConfigPropertyRepresentation) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) NoCache(org.jboss.resteasy.annotations.cache.NoCache)

Example 20 with ProviderConfigProperty

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);
}
Also used : ProviderConfigProperty(org.keycloak.provider.ProviderConfigProperty)

Aggregations

ProviderConfigProperty (org.keycloak.provider.ProviderConfigProperty)30 ArrayList (java.util.ArrayList)3 LinkedList (java.util.LinkedList)3 ComponentFactory (org.keycloak.component.ComponentFactory)3 ComponentTypeRepresentation (org.keycloak.representations.idm.ComponentTypeRepresentation)3 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 NoCache (org.jboss.resteasy.annotations.cache.NoCache)2 MultivaluedHashMap (org.keycloak.common.util.MultivaluedHashMap)2 ConfigPropertyRepresentation (org.keycloak.representations.idm.ConfigPropertyRepresentation)2 IOException (java.io.IOException)1 LinkedHashMap (java.util.LinkedHashMap)1 NotFoundException (javax.ws.rs.NotFoundException)1 ConfigurableAuthenticatorFactory (org.keycloak.authentication.ConfigurableAuthenticatorFactory)1 SubComponentFactory (org.keycloak.component.SubComponentFactory)1 ConfiguredProvider (org.keycloak.provider.ConfiguredProvider)1