本文整理汇总了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();
}