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


Java JdbcTokenStore類代碼示例

本文整理匯總了Java中org.springframework.security.oauth2.provider.token.store.JdbcTokenStore的典型用法代碼示例。如果您正苦於以下問題:Java JdbcTokenStore類的具體用法?Java JdbcTokenStore怎麽用?Java JdbcTokenStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JdbcTokenStore類屬於org.springframework.security.oauth2.provider.token.store包,在下文中一共展示了JdbcTokenStore類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configure

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
    endpoints
            .tokenStore(new JdbcTokenStore(dataSource))
            .authenticationManager(this.authenticationManager)
            .userDetailsService(userDetailsService)
            .tokenServices(tokenServices());
}
 
開發者ID:atereshkov,項目名稱:Diber-backend,代碼行數:9,代碼來源:AuthorizationServerConfiguration.java

示例2: clear

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的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

示例3: revoke

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Override
public void revoke(String token) {
    if (tokenStore instanceof JdbcTokenStore) {
        JdbcTokenStore store = (JdbcTokenStore) tokenStore;
        store.removeRefreshToken(token);
    }
}
 
開發者ID:PacktPublishing,項目名稱:OAuth-2.0-Cookbook,代碼行數:8,代碼來源:RefreshTokenRevocationService.java

示例4: getTokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
public static JdbcTokenStore getTokenStore(DataSource dbDataSource, DataSource secureStoreDataSource) {
    if (secureStoreDataSource.equals(dbDataSource)) {
        LOGGER.info(MessageFormat.format(Messages.OAUTH_TOKEN_STORE, "JdbcTokenStore"));
        return new JdbcTokenStore(dbDataSource);
    }

    LOGGER.info(MessageFormat.format(Messages.OAUTH_TOKEN_STORE, "HanaSecureTokenStore"));
    return new HanaSecureTokenStore(dbDataSource, secureStoreDataSource);
}
 
開發者ID:SAP,項目名稱:cf-mta-deploy-service,代碼行數:10,代碼來源:TokenStoreFactory.java

示例5: configure

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
    endpoints.authenticationManager(authenticationManager)
        .userDetailsService(userDetailsService)
        .tokenEnhancer(new AppTokenEnhancer())
        // require tables oauth_access_token, oauth_client_token, oauth_code, oauth_refresh_token
        .tokenStore(new JdbcTokenStore(dataSource))
        .approvalStore(new JdbcApprovalStore(dataSource))
    ;
}
 
開發者ID:bndynet,項目名稱:web-framework-for-java,代碼行數:11,代碼來源:OAuth2Config.java

示例6: revokeRefreshToken

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@RequestMapping(method = RequestMethod.POST, value = "/tokens/revokeRefreshToken/{tokenId:.*}")
@ResponseBody
public String revokeRefreshToken(@PathVariable String tokenId) {
    if (tokenStore instanceof JdbcTokenStore) {
        ((JdbcTokenStore) tokenStore).removeRefreshToken(tokenId);
    }
    return tokenId;
}
 
開發者ID:Baeldung,項目名稱:spring-security-oauth,代碼行數:9,代碼來源:TokenController.java

示例7: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore() {
    return new JdbcTokenStore(dataSource());
}
 
開發者ID:dazito,項目名稱:oauth2-with-jdbc,代碼行數:5,代碼來源:AppConfig.java

示例8: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore() {
	return new JdbcTokenStore(dataSource());
}
 
開發者ID:rhawan,項目名稱:microservices-tcc-alfa,代碼行數:5,代碼來源:AuthorizationServerConfiguration.java

示例9: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore() {
    return new JdbcTokenStore(dataSource);
}
 
開發者ID:PacktPublishing,項目名稱:OAuth-2.0-Cookbook,代碼行數:5,代碼來源:OAuth2AuthorizationServer.java

示例10: UserService

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder, JdbcTokenStore jdbcTokenStore, AuthorityRepository authorityRepository) {
    this.userRepository = userRepository;
    this.passwordEncoder = passwordEncoder;
    this.jdbcTokenStore = jdbcTokenStore;
    this.authorityRepository = authorityRepository;
}
 
開發者ID:SGKhmCs,項目名稱:speakTogether,代碼行數:7,代碼來源:UserService.java

示例11: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean
public JdbcTokenStore tokenStore() {
    return new JdbcTokenStore(dataSource);
}
 
開發者ID:SGKhmCs,項目名稱:speakTogether,代碼行數:5,代碼來源:OAuth2ServerConfiguration.java

示例12: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean
public JdbcTokenStore tokenStore() {
	return new JdbcTokenStore(dataSource);
}
 
開發者ID:bojanb89pa,項目名稱:OAuth2Spring,代碼行數:5,代碼來源:OAuth2Configuration.java

示例13: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean(name="tokenStore")
public TokenStore tokenStore() {
	return new JdbcTokenStore(this.dataSource);
}
 
開發者ID:PacktPublishing,項目名稱:Building-Web-Apps-with-Spring-5-and-Angular,代碼行數:5,代碼來源:AuthServerOAuth2Config.java

示例14: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore() {
	JdbcTokenStore jdbcTokenStore = new JdbcTokenStore(dataSource);
	return jdbcTokenStore;
}
 
開發者ID:DataAgg,項目名稱:DAFramework,代碼行數:6,代碼來源:WebSecurityConfiguration.java

示例15: tokenStore

import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore() {
	return new JdbcTokenStore(dataSource);
}
 
開發者ID:JerryNiu,項目名稱:cloud,代碼行數:5,代碼來源:AuthorizationServerConfig.java


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