當前位置: 首頁>>代碼示例>>Java>>正文


Java TokenStore類代碼示例

本文整理匯總了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");
	}
}
 
開發者ID:jfcorugedo,項目名稱:spring-oauth2-samples,代碼行數:19,代碼來源:AbstractIntegrationTests.java

示例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;
}
 
開發者ID:cloudfoundry-incubator,項目名稱:credhub,代碼行數:19,代碼來源:AuditOAuth2AccessDeniedHandler.java

示例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);
}
 
開發者ID:rhawan,項目名稱:microservices-tcc-alfa,代碼行數:8,代碼來源:JwtConfiguration.java

示例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());
}
 
開發者ID:rhawan,項目名稱:microservices-tcc-alfa,代碼行數:8,代碼來源:JwtConfiguration.java

示例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;
}
 
開發者ID:codenergic,項目名稱:theskeleton,代碼行數:9,代碼來源:OAuth2AuthorizationServerConfig.java

示例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;
}
 
開發者ID:PacktPublishing,項目名稱:OAuth-2.0-Cookbook,代碼行數:8,代碼來源:JweTokenStore.java

示例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;
}
 
開發者ID:SGKhmCs,項目名稱:speakTogether,代碼行數:9,代碼來源:OAuth2ServerConfiguration.java

示例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;
}
 
開發者ID:SGKhmCs,項目名稱:speakTogether,代碼行數:8,代碼來源:OAuth2ServerConfiguration.java

示例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;
}
 
開發者ID:andrsam,項目名稱:urlshortener,代碼行數:10,代碼來源:SecurityConfig.java

示例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;
}
 
開發者ID:andrsam,項目名稱:urlshortener,代碼行數:8,代碼來源:AuthorizationServerConfiguration.java

示例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
}
 
開發者ID:sniperqpc,項目名稱:Spring-cloud-gather,代碼行數:10,代碼來源:AuthorizationServerConfiguration.java

示例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();
}
 
開發者ID:SeldonIO,項目名稱:seldon-core,代碼行數:14,代碼來源:SeldonGrpcServer.java


注:本文中的org.springframework.security.oauth2.provider.token.TokenStore類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。