Search in sources :

Example 1 with PasswordPolicyTypeRepresentation

use of org.keycloak.representations.idm.PasswordPolicyTypeRepresentation in project keycloak by keycloak.

the class ServerInfoAdminResource method setPasswordPolicies.

private void setPasswordPolicies(ServerInfoRepresentation info) {
    List<PasswordPolicyTypeRepresentation> passwordPolicyTypes = session.getKeycloakSessionFactory().getProviderFactoriesStream(PasswordPolicyProvider.class).map(PasswordPolicyProviderFactory.class::cast).map(factory -> {
        PasswordPolicyTypeRepresentation rep = new PasswordPolicyTypeRepresentation();
        rep.setId(factory.getId());
        rep.setDisplayName(factory.getDisplayName());
        rep.setConfigType(factory.getConfigType());
        rep.setDefaultValue(factory.getDefaultConfigValue());
        rep.setMultipleSupported(factory.isMultiplSupported());
        return rep;
    }).collect(Collectors.toList());
    info.setPasswordPolicies(passwordPolicyTypes);
}
Also used : ConfiguredProvider(org.keycloak.provider.ConfiguredProvider) ComponentTypeRepresentation(org.keycloak.representations.idm.ComponentTypeRepresentation) Theme(org.keycloak.theme.Theme) PasswordPolicyTypeRepresentation(org.keycloak.representations.idm.PasswordPolicyTypeRepresentation) Arrays(java.util.Arrays) ResourceType(org.keycloak.events.admin.ResourceType) Produces(javax.ws.rs.Produces) ClientInstallationRepresentation(org.keycloak.representations.info.ClientInstallationRepresentation) MediaType(javax.ws.rs.core.MediaType) Map(java.util.Map) Spi(org.keycloak.provider.Spi) ThemeInfoRepresentation(org.keycloak.representations.info.ThemeInfoRepresentation) ProtocolMapper(org.keycloak.protocol.ProtocolMapper) Context(javax.ws.rs.core.Context) Collectors(java.util.stream.Collectors) ProtocolMapperRepresentation(org.keycloak.representations.idm.ProtocolMapperRepresentation) SocialIdentityProvider(org.keycloak.broker.social.SocialIdentityProvider) ModelToRepresentation(org.keycloak.models.utils.ModelToRepresentation) ClientInstallationProvider(org.keycloak.protocol.ClientInstallationProvider) List(java.util.List) Stream(java.util.stream.Stream) ComponentFactory(org.keycloak.component.ComponentFactory) WebApplicationException(javax.ws.rs.WebApplicationException) MemoryInfoRepresentation(org.keycloak.representations.info.MemoryInfoRepresentation) LoginProtocol(org.keycloak.protocol.LoginProtocol) SystemInfoRepresentation(org.keycloak.representations.info.SystemInfoRepresentation) OperationType(org.keycloak.events.admin.OperationType) IdentityProviderFactory(org.keycloak.broker.provider.IdentityProviderFactory) Profile(org.keycloak.common.Profile) GET(javax.ws.rs.GET) ProviderConfigProperty(org.keycloak.provider.ProviderConfigProperty) HashMap(java.util.HashMap) LoginProtocolFactory(org.keycloak.protocol.LoginProtocolFactory) ProfileInfoRepresentation(org.keycloak.representations.info.ProfileInfoRepresentation) LinkedHashMap(java.util.LinkedHashMap) PasswordPolicyProviderFactory(org.keycloak.policy.PasswordPolicyProviderFactory) LinkedList(java.util.LinkedList) IdentityProvider(org.keycloak.broker.provider.IdentityProvider) ProviderFactory(org.keycloak.provider.ProviderFactory) PasswordPolicyProvider(org.keycloak.policy.PasswordPolicyProvider) KeycloakSession(org.keycloak.models.KeycloakSession) EventType(org.keycloak.events.EventType) IOException(java.io.IOException) ServerInfoRepresentation(org.keycloak.representations.info.ServerInfoRepresentation) NoCache(org.jboss.resteasy.annotations.cache.NoCache) ProtocolMapperTypeRepresentation(org.keycloak.representations.idm.ProtocolMapperTypeRepresentation) ServerInfoAwareProviderFactory(org.keycloak.provider.ServerInfoAwareProviderFactory) ProviderRepresentation(org.keycloak.representations.info.ProviderRepresentation) Comparator(java.util.Comparator) Collections(java.util.Collections) SpiInfoRepresentation(org.keycloak.representations.info.SpiInfoRepresentation) PasswordPolicyTypeRepresentation(org.keycloak.representations.idm.PasswordPolicyTypeRepresentation) PasswordPolicyProviderFactory(org.keycloak.policy.PasswordPolicyProviderFactory) PasswordPolicyProvider(org.keycloak.policy.PasswordPolicyProvider)

Aggregations

IOException (java.io.IOException)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 Context (javax.ws.rs.core.Context)1 MediaType (javax.ws.rs.core.MediaType)1 NoCache (org.jboss.resteasy.annotations.cache.NoCache)1 IdentityProvider (org.keycloak.broker.provider.IdentityProvider)1 IdentityProviderFactory (org.keycloak.broker.provider.IdentityProviderFactory)1 SocialIdentityProvider (org.keycloak.broker.social.SocialIdentityProvider)1