当前位置: 首页>>代码示例>>Java>>正文


Java InMemoryTokenStore类代码示例

本文整理汇总了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");
	}
}
 
开发者ID:jfcorugedo,项目名称:spring-oauth2-samples,代码行数:19,代码来源:AbstractIntegrationTests.java

示例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);
}
 
开发者ID:nicolasmanic,项目名称:Facegram,代码行数:8,代码来源:OAuth2AuthorizationConfig.java

示例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;
}
 
开发者ID:vdhwouter,项目名称:GameNation,代码行数:14,代码来源:OAuth2Configuration.java

示例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();
}
 
开发者ID:Esemesek,项目名称:spring-oauth2-example,代码行数:5,代码来源:AuthorizationServerConfiguration.java

示例6: tokenStore

import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; //导入依赖的package包/类
@Bean
public TokenStore tokenStore() {
    return new InMemoryTokenStore();
}
 
开发者ID:andrsam,项目名称:urlshortener,代码行数:5,代码来源:AuthorizationServerConfiguration.java

示例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);
}
 
开发者ID:RizkiMufrizal,项目名称:Belajar-Oauth2,代码行数:7,代码来源:Oauth2Config.java

示例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


注:本文中的org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。