本文整理匯總了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);
}
}