当前位置: 首页>>代码示例>>Java>>正文


Java Beans类代码示例

本文整理汇总了Java中org.apereo.cas.configuration.support.Beans的典型用法代码示例。如果您正苦于以下问题:Java Beans类的具体用法?Java Beans怎么用?Java Beans使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Beans类属于org.apereo.cas.configuration.support包,在下文中一共展示了Beans类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: authorizationGenerator

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@RefreshScope
@Bean
public AuthorizationGenerator authorizationGenerator() {
    final LdapAuthorizationProperties ldapAuthz = casProperties.getMgmt().getLdap().getLdapAuthz();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(casProperties.getMgmt().getLdap());

    if (StringUtils.isNotBlank(ldapAuthz.getGroupFilter()) && StringUtils.isNotBlank(ldapAuthz.getGroupAttribute())) {
        return new LdapUserGroupsToRolesAuthorizationGenerator(connectionFactory,
                ldapAuthorizationGeneratorUserSearchExecutor(),
                ldapAuthz.isAllowMultipleResults(),
                ldapAuthz.getGroupAttribute(),
                ldapAuthz.getGroupPrefix(),
                ldapAuthorizationGeneratorGroupSearchExecutor());
    }
    return new LdapUserAttributesToRolesAuthorizationGenerator(connectionFactory,
            ldapAuthorizationGeneratorUserSearchExecutor(),
            ldapAuthz.isAllowMultipleResults(),
            ldapAuthz.getRoleAttribute(),
            ldapAuthz.getRolePrefix());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:21,代码来源:CasManagementLdapAuthorizationConfiguration.java

示例2: queryAndEncodeDatabaseAuthenticationHandler

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
private AuthenticationHandler queryAndEncodeDatabaseAuthenticationHandler(JdbcAuthenticationProperties.Encode b) {
    QueryAndEncodeDatabaseAuthenticationHandler h = new QueryAndEncodeDatabaseAuthenticationHandler(b.getName(), this.servicesManager, this.jdbcPrincipalFactory(), Integer.valueOf(b.getOrder()), Beans.newDataSource(b), b.getAlgorithmName(), b.getSql(), b.getPasswordFieldName(), b.getSaltFieldName(), b.getExpiredFieldName(), b.getDisabledFieldName(), b.getNumberOfIterationsFieldName(), b.getNumberOfIterations(), b.getStaticSalt());
    h.setPasswordEncoder(Beans.newPasswordEncoder(b.getPasswordEncoder()));
    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));
    if (this.queryAndEncodePasswordPolicyConfiguration != null) {
        h.setPasswordPolicyConfiguration(this.queryAndEncodePasswordPolicyConfiguration);
    }

    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));
    if (StringUtils.isNotBlank(b.getCredentialCriteria())) {
        h.setCredentialSelectionPredicate(Beans.newCredentialSelectionPredicate(b.getCredentialCriteria()));
    }

    LOGGER.debug("Created authentication handler [{}] to handle database url at [{}]", h.getName(), b.getUrl());
    return h;
}
 
开发者ID:guolf,项目名称:cas-overlay,代码行数:17,代码来源:MyJdbcAuthenticationHandlers.java

示例3: build

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
private AuthorizationGenerator<CommonProfile> build() {
    final LdapAuthorizationProperties ldapAuthz = adminPagesSecurityProperties.getLdap().getLdapAuthz();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(adminPagesSecurityProperties.getLdap());

    if (isGroupBasedAuthorization()) {
        LOGGER.debug("Handling LDAP authorization based on groups");
        return new LdapUserGroupsToRolesAuthorizationGenerator(connectionFactory,
                ldapAuthorizationGeneratorUserSearchExecutor(),
                ldapAuthz.isAllowMultipleResults(),
                ldapAuthz.getGroupAttribute(),
                ldapAuthz.getGroupPrefix(),
                ldapAuthorizationGeneratorGroupSearchExecutor());
    }
    LOGGER.debug("Handling LDAP authorization based on attributes and roles");
    return new LdapUserAttributesToRolesAuthorizationGenerator(connectionFactory,
            ldapAuthorizationGeneratorUserSearchExecutor(),
            ldapAuthz.isAllowMultipleResults(),
            ldapAuthz.getRoleAttribute(),
            ldapAuthz.getRolePrefix());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:21,代码来源:CasLdapUserDetailsManagerConfigurer.java

示例4: queryDatabaseAuthenticationHandler

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
private AuthenticationHandler queryDatabaseAuthenticationHandler(final JdbcAuthenticationProperties.Query b) {
    final Map<String, String> attributes = Beans.transformPrincipalAttributesListIntoMap(b.getPrincipalAttributeList());
    LOGGER.debug("Created and mapped principal attributes [{}] for [{}]...", attributes, b.getUrl());

    final QueryDatabaseAuthenticationHandler h = new QueryDatabaseAuthenticationHandler(b.getName(), servicesManager,
            jdbcPrincipalFactory(), b.getOrder(),
            Beans.newDataSource(b), b.getSql(), b.getFieldPassword(),
            b.getFieldExpired(), b.getFieldDisabled(), attributes);

    h.setPasswordEncoder(Beans.newPasswordEncoder(b.getPasswordEncoder()));
    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));

    if (queryPasswordPolicyConfiguration != null) {
        h.setPasswordPolicyConfiguration(queryPasswordPolicyConfiguration);
    }

    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));

    if (StringUtils.isNotBlank(b.getCredentialCriteria())) {
        h.setCredentialSelectionPredicate(Beans.newCredentialSelectionPredicate(b.getCredentialCriteria()));
    }

    LOGGER.debug("Created authentication handler [{}] to handle database url at [{}]", h.getName(), b.getUrl());
    return h;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:26,代码来源:CasJdbcAuthenticationConfiguration.java

示例5: searchModeSearchDatabaseAuthenticationHandler

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
private AuthenticationHandler searchModeSearchDatabaseAuthenticationHandler(final JdbcAuthenticationProperties.Search b) {
    final SearchModeSearchDatabaseAuthenticationHandler h = new SearchModeSearchDatabaseAuthenticationHandler(b.getName(), servicesManager,
            jdbcPrincipalFactory(), b.getOrder(), Beans.newDataSource(b), b.getFieldUser(), b.getFieldPassword(), b.getTableUsers());

    h.setPasswordEncoder(Beans.newPasswordEncoder(b.getPasswordEncoder()));
    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));
    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));

    if (searchModePasswordPolicyConfiguration != null) {
        h.setPasswordPolicyConfiguration(searchModePasswordPolicyConfiguration);
    }

    if (StringUtils.isNotBlank(b.getCredentialCriteria())) {
        h.setCredentialSelectionPredicate(Beans.newCredentialSelectionPredicate(b.getCredentialCriteria()));
    }

    LOGGER.debug("Created authentication handler [{}] to handle database url at [{}]", h.getName(), b.getUrl());
    return h;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:20,代码来源:CasJdbcAuthenticationConfiguration.java

示例6: bindModeSearchDatabaseAuthenticationHandler

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
private AuthenticationHandler bindModeSearchDatabaseAuthenticationHandler(JdbcAuthenticationProperties.Bind b) {
    BindModeSearchDatabaseAuthenticationHandler h = new BindModeSearchDatabaseAuthenticationHandler(b.getName(), this.servicesManager, this.jdbcPrincipalFactory(), b.getOrder(), Beans.newDataSource(b));
    h.setPasswordEncoder(Beans.newPasswordEncoder(b.getPasswordEncoder()));
    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));
    if (this.bindSearchPasswordPolicyConfiguration != null) {
        h.setPasswordPolicyConfiguration(this.bindSearchPasswordPolicyConfiguration);
    }

    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));
    if (StringUtils.isNotBlank(b.getCredentialCriteria())) {
        h.setCredentialSelectionPredicate(Beans.newCredentialSelectionPredicate(b.getCredentialCriteria()));
    }

    LOGGER.debug("Created authentication handler [{}] to handle database url at [{}]", h.getName(), b.getUrl());
    return h;
}
 
开发者ID:guolf,项目名称:cas-overlay,代码行数:17,代码来源:MyJdbcAuthenticationHandlers.java

示例7: ldapSpnegoClientAction

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@Lazy
@Bean
@RefreshScope
public Action ldapSpnegoClientAction() {
    final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(spnegoProperties.getLdap());
    final SearchFilter filter = Beans.newLdaptiveSearchFilter(spnegoProperties.getLdap().getSearchFilter(),
            "host", Collections.emptyList());

    final SearchRequest searchRequest = Beans.newLdaptiveSearchRequest(spnegoProperties.getLdap().getBaseDn(), filter);
    return new LdapSpnegoKnownClientSystemsFilterAction(spnegoProperties.getIpsToCheckPattern(), 
            spnegoProperties.getAlternativeRemoteHostAttribute(),
            spnegoProperties.getDnsTimeout(), 
            connectionFactory, 
            searchRequest, 
            spnegoProperties.getSpnegoAttributeName());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:18,代码来源:SpnegoWebflowActionsConfiguration.java

示例8: canAuthenticateAs

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@Override
public boolean canAuthenticateAs(final String username, final Principal surrogate) {
    try {
        if (username.equalsIgnoreCase(surrogate.getId())) {
            return true;
        }
        
        final SearchFilter filter = Beans.newLdaptiveSearchFilter(ldapProperties.getSurrogateSearchFilter(), Arrays.asList(username));
        LOGGER.debug("Using search filter: [{}]", filter);

        final Response<SearchResult> response = LdapUtils.executeSearchOperation(this.connectionFactory,
                ldapProperties.getBaseDn(), filter);
        LOGGER.debug("LDAP response: [{}]", response);
        return LdapUtils.containsResultEntry(response);
    } catch (final Exception e) {
        LOGGER.error(e.getMessage(), e);
    }
    return false;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:20,代码来源:LdapSurrogateUsernamePasswordService.java

示例9: surrogateAuthenticationService

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@RefreshScope
@ConditionalOnMissingBean(name = "surrogateAuthenticationService")
@Bean
public SurrogateAuthenticationService surrogateAuthenticationService() {
    try {
        final SurrogateAuthenticationProperties su = casProperties.getAuthn().getSurrogate();
        if (su.getJson().getConfig().getLocation() != null) {
            LOGGER.debug("Using JSON resource [{}] to locate surrogate accounts", su.getJson().getConfig().getLocation());
            return new JsonResourceSurrogateAuthenticationService(su.getJson().getConfig().getLocation());
        }
        if (StringUtils.hasText(su.getLdap().getLdapUrl()) && StringUtils.hasText(su.getLdap().getSearchFilter())
                && StringUtils.hasText(su.getLdap().getBaseDn()) && StringUtils.hasText(su.getLdap().getMemberAttributeName())) {
            LOGGER.debug("Using LDAP [{}] with baseDn [{}] to locate surrogate accounts",
                    su.getLdap().getLdapUrl(), su.getLdap().getBaseDn());
            final ConnectionFactory factory = Beans.newLdaptivePooledConnectionFactory(su.getLdap());
            return new LdapSurrogateUsernamePasswordService(factory, su.getLdap());
        }

        final Map<String, Set> accounts = new LinkedHashMap<>();
        su.getSimple().getSurrogates().forEach((k, v) -> accounts.put(k, StringUtils.commaDelimitedListToSet(v)));
        LOGGER.debug("Using accounts [{}] for surrogate authentication", accounts);
        return new SimpleSurrogateAuthenticationService(accounts);
    } catch (final Exception e) {
        throw new BeanCreationException(e.getMessage(), e);
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:27,代码来源:SurrogateAuthenticationConfiguration.java

示例10: jaasAuthenticationHandlers

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@ConditionalOnMissingBean(name = "jaasAuthenticationHandlers")
@RefreshScope
@Bean
public List<AuthenticationHandler> jaasAuthenticationHandlers() {
    return casProperties.getAuthn().getJaas()
            .stream()
            .filter(jaas -> StringUtils.isNotBlank(jaas.getRealm()))
            .map(jaas -> {
                final JaasAuthenticationHandler h = new JaasAuthenticationHandler(jaas.getName(),
                        servicesManager, jaasPrincipalFactory(), null);

                h.setKerberosKdcSystemProperty(jaas.getKerberosKdcSystemProperty());
                h.setKerberosRealmSystemProperty(jaas.getKerberosRealmSystemProperty());
                h.setRealm(jaas.getRealm());
                h.setPasswordEncoder(Beans.newPasswordEncoder(jaas.getPasswordEncoder()));

                if (jaasPasswordPolicyConfiguration != null) {
                    h.setPasswordPolicyConfiguration(jaasPasswordPolicyConfiguration);
                }
                h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(jaas.getPrincipalTransformation()));
                h.setCredentialSelectionPredicate(Beans.newCredentialSelectionPredicate(jaas.getCredentialCriteria()));
                return h;
            })
            .collect(Collectors.toList());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:26,代码来源:CasCoreAuthenticationHandlersConfiguration.java

示例11: locate

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@Override
public PropertySource<?> locate(final Environment environment) {
    final Properties props = new Properties();

    try {
        final JdbcCloudConnection connection = new JdbcCloudConnection(environment);
        final DataSource dataSource = Beans.newDataSource(connection);
        final JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        final List<Map<String, Object>> rows = jdbcTemplate.queryForList(connection.getSql());
        for (final Map row : rows) {
            props.put(row.get("name"), row.get("value"));
        }
    } catch (final Exception e) {
        LOGGER.error(e.getMessage(), e);
    }
    return new PropertiesPropertySource(getClass().getSimpleName(), props);
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:18,代码来源:JdbcCloudConfigBootstrapConfiguration.java

示例12: configure

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@Override
public void configure(final AuthenticationManagerBuilder auth) throws Exception {
    usersByUsernameQuery(adminPagesSecurityProperties.getJdbc().getQuery());
    rolePrefix(adminPagesSecurityProperties.getJdbc().getRolePrefix());
    dataSource(Beans.newDataSource(adminPagesSecurityProperties.getJdbc()));
    passwordEncoder(Beans.newPasswordEncoder(adminPagesSecurityProperties.getJdbc().getPasswordEncoder()));
    super.configure(auth);
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:9,代码来源:CasJdbcUserDetailsManagerConfigurer.java

示例13: eventsEntityManagerFactory

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean eventsEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean =
            Beans.newHibernateEntityManagerFactoryBean(
                    new JpaConfigDataHolder(
                            jpaEventVendorAdapter(),
                            "jpaEventRegistryContext",
                            jpaEventPackagesToScan(),
                            dataSourceEvent()),
                    casProperties.getEvents().getJpa());

    return bean;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:15,代码来源:JpaEventsConfiguration.java

示例14: googleAuthenticatorEntityManagerFactory

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean googleAuthenticatorEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean =
            Beans.newHibernateEntityManagerFactoryBean(
                    new JpaConfigDataHolder(
                            jpaGoogleAuthenticatorVendorAdapter(),
                            "jpaGoogleAuthenticatorContext",
                            jpaPackagesToScanGoogleAuthenticator(),
                            dataSourceGoogleAuthenticator()),
                    casProperties.getAuthn().getMfa().getGauth().getJpa().getDatabase());

    return bean;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:15,代码来源:GoogleAuthenticatorJpaConfiguration.java

示例15: searchForId

import org.apereo.cas.configuration.support.Beans; //导入依赖的package包/类
/**
 * Search for service by id.
 *
 * @param id the id
 * @return the response
 * @throws LdapException the ldap exception
 */
private Response<SearchResult> searchForId(final String id) throws LdapException {

    final SearchFilter filter = Beans.newLdaptiveSearchFilter(this.searchFilter,
            Beans.LDAP_SEARCH_FILTER_DEFAULT_PARAM_NAME,
            Arrays.asList(id));
    return LdapUtils.executeSearchOperation(this.connectionFactory, this.baseDn, filter);
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:15,代码来源:LdapAcceptableUsagePolicyRepository.java


注:本文中的org.apereo.cas.configuration.support.Beans类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。