本文整理匯總了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);
}