当前位置: 首页>>代码示例>>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;未经允许,请勿转载。