本文整理汇总了Java中org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore类的典型用法代码示例。如果您正苦于以下问题:Java InMemoryTokenStore类的具体用法?Java InMemoryTokenStore怎么用?Java InMemoryTokenStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InMemoryTokenStore类属于org.springframework.security.oauth2.provider.token.store包,在下文中一共展示了InMemoryTokenStore类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clear
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的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");
}
}
示例2: configure
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints
.tokenStore(new InMemoryTokenStore())
.authenticationManager(authenticationManager) //Enable password grant type.
.userDetailsService(userService);
}
示例3: tokenStore
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
TokenStore store = new InMemoryTokenStore();
// add new token to store, this is an unlimited token to use during testing
UnlimitedToken token = new UnlimitedToken();
UnlimitedAuthentication unlimitedAuthentication = new UnlimitedAuthentication();
OAuth2Request request = new OAuth2Request(new HashMap<String, String>(), "web-gamenation", unlimitedAuthentication.getAuthorities(), true, token.getScope(), null, "", new HashSet<String>(), new HashMap<String, Serializable>());
OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(request, unlimitedAuthentication);
store.storeAccessToken(token, oAuth2Authentication);
return store;
}
示例4: tokenStore
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
return new InMemoryTokenStore();
}
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:5,代码来源:OAuth2AutoConfigurationTests.java
示例5: inMemoryTokenStore
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Bean
public InMemoryTokenStore inMemoryTokenStore() {
return new InMemoryTokenStore();
}
示例6: tokenStore
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
return new InMemoryTokenStore();
}
示例7: configure
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Override
public void configure(AuthorizationServerEndpointsConfigurer authorizationServerEndpointsConfigurer) throws Exception {
authorizationServerEndpointsConfigurer
.tokenStore(new InMemoryTokenStore())
.authenticationManager(authenticationManager);
}
示例8: tokenStore
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Bean
protected TokenStore tokenStore() {
return new InMemoryTokenStore();
}
开发者ID:Appverse,项目名称:appverse-server,代码行数:5,代码来源:AuthorizationServerInMemoryStoreConfigurerAdapter.java