本文整理匯總了Java中org.springframework.security.oauth2.provider.token.TokenStore類的典型用法代碼示例。如果您正苦於以下問題:Java TokenStore類的具體用法?Java TokenStore怎麽用?Java TokenStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TokenStore類屬於org.springframework.security.oauth2.provider.token包,在下文中一共展示了TokenStore類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: clear
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
private void clear(TokenStore tokenStore) throws Exception {
if (tokenStore instanceof Advised) {
Advised advised = (Advised) tokenStore;
TokenStore target = (TokenStore) advised.getTargetSource().getTarget();
clear(target);
return;
}
if (tokenStore instanceof InMemoryTokenStore) {
((InMemoryTokenStore) tokenStore).clear();
}
if (tokenStore instanceof JdbcTokenStore) {
JdbcTemplate template = new JdbcTemplate(dataSource);
template.execute("delete from oauth_access_token");
template.execute("delete from oauth_refresh_token");
template.execute("delete from oauth_client_token");
template.execute("delete from oauth_code");
}
}
示例2: AuditOAuth2AccessDeniedHandler
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Autowired
public AuditOAuth2AccessDeniedHandler(
TokenStore tokenStore,
RequestAuditRecordDataService requestAuditRecordDataService,
SecurityEventsLogService securityEventsLogService,
UserContextFactory userContextFactory,
WebResponseExceptionTranslator exceptionTranslator,
AuditLogFactory auditLogFactory,
MessageSourceAccessor messageSourceAccessor
) {
this.userContextFactory = userContextFactory;
this.tokenStore = tokenStore;
this.requestAuditRecordDataService = requestAuditRecordDataService;
this.securityEventsLogService = securityEventsLogService;
this.exceptionTranslator = exceptionTranslator;
this.auditLogFactory = auditLogFactory;
this.messageSourceAccessor = messageSourceAccessor;
}
示例3: tokenStore
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Bean
@Qualifier("tokenStore")
public TokenStore tokenStore() {
System.out.println("Created JwtTokenStore");
return new JwtTokenStore(jwtAccessTokenConverter);
}
示例4: jwkTokenServices
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(ResourceServerTokenServices.class)
public DefaultTokenServices jwkTokenServices(TokenStore jwkTokenStore) {
DefaultTokenServices services = new DefaultTokenServices();
services.setTokenStore(jwkTokenStore);
return services;
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:8,代碼來源:ResourceServerTokenServicesConfiguration.java
示例5: jwtTokenServices
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(ResourceServerTokenServices.class)
public DefaultTokenServices jwtTokenServices(TokenStore jwtTokenStore) {
DefaultTokenServices services = new DefaultTokenServices();
services.setTokenStore(jwtTokenStore);
return services;
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:8,代碼來源:ResourceServerTokenServicesConfiguration.java
示例6: OAuth2AuthorizationServerConfiguration
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
public OAuth2AuthorizationServerConfiguration(BaseClientDetails details,
AuthenticationConfiguration authenticationConfiguration,
ObjectProvider<TokenStore> tokenStore,
ObjectProvider<AccessTokenConverter> tokenConverter,
AuthorizationServerProperties properties) throws Exception {
this.details = details;
this.authenticationManager = authenticationConfiguration.getAuthenticationManager();
this.tokenStore = tokenStore.getIfAvailable();
this.tokenConverter = tokenConverter.getIfAvailable();
this.properties = properties;
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:12,代碼來源:OAuth2AuthorizationServerConfiguration.java
示例7: tokenStore
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Bean
@Qualifier("tokenStore")
public TokenStore tokenStore() {
System.out.println("Created JwtTokenStore");
return new JwtTokenStore(jwtTokenEnhancer());
}
示例8: OAuth2AuthorizationServerConfig
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
public OAuth2AuthorizationServerConfig(AccessTokenConverter accessTokenConverter, ApprovalStore approvalStore, AuthenticationManager authenticationManager, OAuth2ClientService clientService, TokenEnhancer tokenEnhancer, TokenStore tokenStore) {
this.accessTokenConverter = accessTokenConverter;
this.approvalStore = approvalStore;
this.authenticationManager = authenticationManager;
this.clientService = clientService;
this.tokenEnhancer = tokenEnhancer;
this.tokenStore = tokenStore;
}
示例9: JweTokenStore
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
public JweTokenStore(String encodedSigningKey, TokenStore delegate,
JwtAccessTokenConverter converter, JweTokenSerializer crypto) {
this.encodedSigningKey = encodedSigningKey;
this.delegate = delegate;
this.converter = converter;
this.crypto = crypto;
}
示例10: ResourceServerConfiguration
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
public ResourceServerConfiguration(TokenStore tokenStore, Http401UnauthorizedEntryPoint http401UnauthorizedEntryPoint,
AjaxLogoutSuccessHandler ajaxLogoutSuccessHandler, CorsFilter corsFilter) {
this.tokenStore = tokenStore;
this.http401UnauthorizedEntryPoint = http401UnauthorizedEntryPoint;
this.ajaxLogoutSuccessHandler = ajaxLogoutSuccessHandler;
this.corsFilter = corsFilter;
}
示例11: AuthorizationServerConfiguration
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
public AuthorizationServerConfiguration(@Qualifier("authenticationManagerBean") AuthenticationManager authenticationManager,
TokenStore tokenStore, DataSource dataSource) {
this.authenticationManager = authenticationManager;
this.tokenStore = tokenStore;
this.dataSource = dataSource;
}
示例12: userApprovalHandler
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Bean
@Autowired
public TokenStoreUserApprovalHandler userApprovalHandler(TokenStore tokenStore) {
TokenStoreUserApprovalHandler handler = new TokenStoreUserApprovalHandler();
handler.setTokenStore(tokenStore);
handler.setRequestFactory(new DefaultOAuth2RequestFactory(clientDetailsService));
handler.setClientDetailsService(clientDetailsService);
return handler;
}
示例13: approvalStore
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Bean
@Autowired
public ApprovalStore approvalStore(TokenStore tokenStore) throws Exception {
TokenApprovalStore store = new TokenApprovalStore();
store.setTokenStore(tokenStore);
return store;
}
示例14: configure
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
TokenStore tokenStore = new RedisTokenStore(redisConnectionFactory);
// @formatter:off
endpoints.tokenStore(tokenStore)
.authenticationManager(authenticationManager)
.userDetailsService(userDetailsService);
// @formatter:on
}
示例15: SeldonGrpcServer
import org.springframework.security.oauth2.provider.token.TokenStore; //導入依賴的package包/類
public SeldonGrpcServer(AppProperties appProperties,DeploymentStore deploymentStore,TokenStore tokenStore,ServerBuilder<?> serverBuilder,DeploymentsHandler deploymentsHandler, int port)
{
this.appProperties = appProperties;
this.deploymentStore = deploymentStore;
this.tokenStore = tokenStore;
this.grpcDeploymentsListener = new grpcDeploymentsListener(this);
this.deploymentsHandler = deploymentsHandler;
deploymentsHandler.addListener(this.grpcDeploymentsListener);
this.port = port;
server = serverBuilder
.addService(ServerInterceptors.intercept(new SeldonService(this), new HeaderServerInterceptor(this)))
.build();
}