本文整理汇总了Java中org.springframework.cloud.context.config.annotation.RefreshScope类的典型用法代码示例。如果您正苦于以下问题:Java RefreshScope类的具体用法?Java RefreshScope怎么用?Java RefreshScope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RefreshScope类属于org.springframework.cloud.context.config.annotation包,在下文中一共展示了RefreshScope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: authorizationGenerator
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的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());
}
示例2: idPInitiatedSamlProfileHandlerController
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@Bean
@RefreshScope
public IdPInitiatedProfileHandlerController idPInitiatedSamlProfileHandlerController() {
final SamlIdPProperties idp = casProperties.getAuthn().getSamlIdp();
return new IdPInitiatedProfileHandlerController(
samlObjectSigner(),
openSamlConfigBean.getParserPool(),
authenticationSystemSupport,
servicesManager,
webApplicationServiceFactory,
defaultSamlRegisteredServiceCachingMetadataResolver(),
openSamlConfigBean,
samlProfileSamlResponseBuilder(),
idp.getAuthenticationContextClassMappings(),
casProperties.getServer().getPrefix(),
casProperties.getServer().getName(),
casProperties.getAuthn().getMfa().getRequestParameter(),
casProperties.getServer().getLoginUrl(),
casProperties.getServer().getLogoutUrl(),
idp.getLogout().isForceSignedLogoutRequests(),
idp.getLogout().isSingleLogoutCallbacksDisabled(),
samlIdPObjectSignatureValidator());
}
示例3: authenticationThrottle
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@RefreshScope
@ConditionalOnMissingBean(name = "authenticationThrottle")
@Bean
public ThrottledSubmissionHandlerInterceptor authenticationThrottle() {
final ThrottleProperties throttle = casProperties.getAuthn().getThrottle();
if (throttle.getFailure().getThreshold() > 0
&& throttle.getFailure().getRangeSeconds() > 0) {
if (StringUtils.isNotBlank(throttle.getUsernameParameter())) {
return new InMemoryThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter(throttle.getFailure().getThreshold(),
throttle.getFailure().getRangeSeconds(), throttle.getUsernameParameter());
}
return new InMemoryThrottledSubmissionByIpAddressHandlerInterceptorAdapter(throttle.getFailure().getThreshold(),
throttle.getFailure().getRangeSeconds(), throttle.getUsernameParameter());
}
return neverThrottle();
}
示例4: sloPostProfileHandlerController
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@Bean
@RefreshScope
public SLOPostProfileHandlerController sloPostProfileHandlerController() {
final SamlIdPProperties idp = casProperties.getAuthn().getSamlIdp();
return new SLOPostProfileHandlerController(
samlObjectSigner(),
openSamlConfigBean.getParserPool(),
authenticationSystemSupport,
servicesManager,
webApplicationServiceFactory,
defaultSamlRegisteredServiceCachingMetadataResolver(),
openSamlConfigBean,
samlProfileSamlResponseBuilder(),
casProperties.getAuthn().getSamlIdp().getAuthenticationContextClassMappings(),
casProperties.getServer().getPrefix(),
casProperties.getServer().getName(),
casProperties.getAuthn().getMfa().getRequestParameter(),
casProperties.getServer().getLoginUrl(),
casProperties.getServer().getLogoutUrl(),
idp.getLogout().isForceSignedLogoutRequests(),
idp.getLogout().isSingleLogoutCallbacksDisabled(),
samlObjectSignatureValidator());
}
示例5: grouperMultifactorAuthenticationWebflowEventResolver
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@Autowired
@Bean
@RefreshScope
public CasWebflowEventResolver grouperMultifactorAuthenticationWebflowEventResolver(@Qualifier("defaultAuthenticationSystemSupport")
final AuthenticationSystemSupport authenticationSystemSupport) {
final AbstractCasWebflowEventResolver r;
if (StringUtils.isNotBlank(casProperties.getAuthn().getMfa().getGrouperGroupField())) {
r = new GrouperMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager,
ticketRegistrySupport, warnCookieGenerator,
authenticationRequestServiceSelectionStrategies, multifactorAuthenticationProviderSelector,
casProperties);
LOGGER.debug("Activating MFA event resolver based on Grouper groups...");
} else {
r = new NoOpCasWebflowEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport,
warnCookieGenerator, authenticationRequestServiceSelectionStrategies, multifactorAuthenticationProviderSelector);
}
this.initialAuthenticationAttemptWebflowEventResolver.addDelegate(r);
return r;
}
示例6: attributeRepositories
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@ConditionalOnMissingBean(name = "attributeRepositories")
@Bean
@RefreshScope
public List<IPersonAttributeDao> attributeRepositories() {
final List<IPersonAttributeDao> list = new ArrayList<>();
list.addAll(ldapAttributeRepositories());
list.addAll(jdbcAttributeRepositories());
list.addAll(jsonAttributeRepositories());
list.addAll(groovyAttributeRepositories());
list.addAll(grouperAttributeRepositories());
list.addAll(stubAttributeRepositories());
OrderComparator.sort(list);
LOGGER.debug("Final list of attribute repositories is [{}]", list);
return list;
}
示例7: jaasAuthenticationHandlers
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的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());
}
示例8: yubikeyAuthenticationProvider
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@Bean
@RefreshScope
public MultifactorAuthenticationProvider yubikeyAuthenticationProvider() {
final YubiKeyMultifactorAuthenticationProvider p = new YubiKeyMultifactorAuthenticationProvider(
yubikeyAuthenticationHandler(),
this.httpClient);
p.setBypassEvaluator(yubikeyBypassEvaluator());
p.setGlobalFailureMode(casProperties.getAuthn().getMfa().getGlobalFailureMode());
p.setOrder(casProperties.getAuthn().getMfa().getYubikey().getRank());
p.setId(casProperties.getAuthn().getMfa().getYubikey().getId());
return p;
}
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:13,代码来源:YubiKeyAuthenticationEventExecutionPlanConfiguration.java
示例9: callbackAuthorizeController
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(name = "callbackAuthorizeController")
@RefreshScope
public OAuth20CallbackAuthorizeEndpointController callbackAuthorizeController() {
return new OAuth20CallbackAuthorizeEndpointController(servicesManager, ticketRegistry,
oAuthValidator(), defaultAccessTokenFactory(), oauthPrincipalFactory(), webApplicationServiceFactory,
oauthSecConfig(), callbackController(), callbackAuthorizeViewResolver(),
profileScopeToAttributesFilter(), casProperties, ticketGrantingTicketCookieGenerator);
}
示例10: oidcPrincipalFactory
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@RefreshScope
@Bean
public OidcDynamicClientRegistrationEndpointController oidcDynamicClientRegistrationEndpointController() {
return new OidcDynamicClientRegistrationEndpointController(
servicesManager, ticketRegistry, oAuth20Validator, defaultAccessTokenFactory,
oidcPrincipalFactory(), webApplicationServiceFactory, clientRegistrationRequestSerializer(),
new DefaultRandomStringGenerator(),
new DefaultRandomStringGenerator(),
profileScopeToAttributesFilter(),
casProperties, ticketGrantingTicketCookieGenerator);
}
示例11: localeChangeInterceptor
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@RefreshScope
@Bean
public LocaleChangeInterceptor localeChangeInterceptor() {
final LocaleChangeInterceptor bean = new LocaleChangeInterceptor();
bean.setParamName(this.casProperties.getLocale().getParamName());
return bean;
}
示例12: userDefinedScopeBasedAttributeReleasePolicies
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@RefreshScope
@Bean
public Collection<BaseOidcScopeAttributeReleasePolicy> userDefinedScopeBasedAttributeReleasePolicies() {
final OidcProperties oidc = casProperties.getAuthn().getOidc();
return oidc.getUserDefinedScopes().entrySet()
.stream()
.map(k-> new OidcCustomScopeAttributeReleasePolicy(k.getKey(), Arrays.asList(k.getValue().split(","))))
.collect(Collectors.toSet());
}
示例13: viewFactoryCreator
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@RefreshScope
@Bean
public ViewFactoryCreator viewFactoryCreator() {
final MvcViewFactoryCreator resolver = new MvcViewFactoryCreator();
resolver.setViewResolvers(Collections.singletonList(this.registeredServiceViewResolver));
return resolver;
}
示例14: casAttributeEncoder
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@ConditionalOnMissingBean(name = "casAttributeEncoder")
@RefreshScope
@Bean
public ProtocolAttributeEncoder casAttributeEncoder(@Qualifier("serviceRegistryDao") final ServiceRegistryDao serviceRegistryDao,
@Qualifier("cacheCredentialsCipherExecutor") final CipherExecutor cacheCredentialsCipherExecutor) {
return new DefaultCasProtocolAttributeEncoder(servicesManager(serviceRegistryDao),
registeredServiceCipherExecutor(), cacheCredentialsCipherExecutor);
}
示例15: mongoMfaTrustedAuthnDbFactory
import org.springframework.cloud.context.config.annotation.RefreshScope; //导入依赖的package包/类
@RefreshScope
@Bean
public MongoDbFactory mongoMfaTrustedAuthnDbFactory() {
try {
return new SimpleMongoDbFactory(new MongoClientURI(
casProperties.getAuthn().getMfa().getTrusted().getMongodb().getClientUri()));
} catch (final Exception e) {
throw new BeanCreationException(e.getMessage(), e);
}
}