本文整理汇总了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());
}
示例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");
}
}
示例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);
}
}
示例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);
}
示例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))
;
}
示例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;
}
示例7: tokenStore
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
return new JdbcTokenStore(dataSource());
}
示例8: tokenStore
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
return new JdbcTokenStore(dataSource());
}
示例9: tokenStore
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
return new JdbcTokenStore(dataSource);
}
示例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;
}
示例11: tokenStore
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //导入依赖的package包/类
@Bean
public JdbcTokenStore tokenStore() {
return new JdbcTokenStore(dataSource);
}
示例12: tokenStore
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //导入依赖的package包/类
@Bean
public JdbcTokenStore tokenStore() {
return new JdbcTokenStore(dataSource);
}
示例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;
}
示例15: tokenStore
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
return new JdbcTokenStore(dataSource);
}