當前位置: 首頁>>代碼示例>>Java>>正文


Java JwtTokenStore類代碼示例

本文整理匯總了Java中org.springframework.security.oauth2.provider.token.store.JwtTokenStore的典型用法代碼示例。如果您正苦於以下問題:Java JwtTokenStore類的具體用法?Java JwtTokenStore怎麽用?Java JwtTokenStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JwtTokenStore類屬於org.springframework.security.oauth2.provider.token.store包,在下文中一共展示了JwtTokenStore類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setup

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Before
public void setup() throws Exception {
    MockitoAnnotations.initMocks(this);
    JwtAccessTokenConverter converter = new DomainJwtAccessTokenConverter();
    KeyPair keyPair = new KeyStoreKeyFactory(
        new ClassPathResource(KEYSTORE_PATH), KEYSTORE_PSWRD.toCharArray())
        .getKeyPair(KEYSTORE_ALIAS);
    converter.setKeyPair(keyPair);
    converter.afterPropertiesSet();
    tokenStore = new JwtTokenStore(converter);
    tokenServices = new DomainTokenServices();
    tokenServices.setTokenStore(tokenStore);
    tokenServices.setTokenEnhancer(converter);
    tokenServices.setTenantPropertiesService(tenantPropertiesService);
    when(tenantPropertiesService.getTenantProps()).thenReturn(tenantProperties);
    when(tenantProperties.getSecurity()).thenReturn(security);
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:18,代碼來源:DomainTokenServicesUnitTest.java

示例2: jwtTokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
/**
 * @return The {@link JwtTokenStore} verifies access tokens and extract
 *         authentication and authorities from it.
 */
@Bean
public JwtTokenStore jwtTokenStore() {
    final DefaultAccessTokenConverter accessTokenConverter = new DefaultAccessTokenConverter();
    accessTokenConverter.setUserTokenConverter(userPrincipalInfoTokenServices());
    final JwtAccessTokenConverter jwtTokenEnhancer = new JwtAccessTokenConverter();
    jwtTokenEnhancer.setAccessTokenConverter(accessTokenConverter);
    jwtTokenEnhancer.setSigningKey(uaaClientResources.getResource().getJwt().getKeyValue());
    jwtTokenEnhancer.setVerifierKey(uaaClientResources.getResource().getJwt().getKeyValue());
    try {
        jwtTokenEnhancer.afterPropertiesSet();
    } catch (final Exception e) {
        throw Throwables.propagate(e);
    }
    return new JwtTokenStore(jwtTokenEnhancer);
}
 
開發者ID:eclipse,項目名稱:hawkbit-extensions,代碼行數:20,代碼來源:UaaOAuthAutoConfiguration.java

示例3: jwtTokenStoreShouldBeConditionalOnMissingBean

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Test
public void jwtTokenStoreShouldBeConditionalOnMissingBean() throws Exception {
	TestPropertyValues.of("security.oauth2.resource.jwt.keyValue=" + PUBLIC_KEY)
			.applyTo(this.environment);
	this.context = new SpringApplicationBuilder(JwtTokenStoreConfiguration.class,
			ResourceConfiguration.class).environment(this.environment)
					.web(WebApplicationType.NONE).run();
	assertThat(this.context.getBeansOfType(JwtTokenStore.class)).hasSize(1);
}
 
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:10,代碼來源:ResourceServerTokenServicesConfigurationTests.java

示例4: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
@Qualifier("tokenStore")
public TokenStore tokenStore() {

    System.out.println("Created JwtTokenStore");
    return new JwtTokenStore(jwtAccessTokenConverter);
}
 
開發者ID:rhawan,項目名稱:microservices-tcc-alfa,代碼行數:8,代碼來源:JwtConfiguration.java

示例5: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
@Qualifier("tokenStore")
public TokenStore tokenStore() {

    System.out.println("Created JwtTokenStore");
    return new JwtTokenStore(jwtTokenEnhancer());
}
 
開發者ID:rhawan,項目名稱:microservices-tcc-alfa,代碼行數:8,代碼來源:JwtConfiguration.java

示例6: configure

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Override
public void configure(final AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
    // @formatter:off
    endpoints
        .tokenStore(new JwtTokenStore(jwtAccessTokenConverter))
        .authenticationManager(authenticationManager)
        .accessTokenConverter(jwtAccessTokenConverter);
    // @formatter:on
}
 
開發者ID:zeldan,項目名稱:spring-boot-oauth2-password-flow,代碼行數:10,代碼來源:OAuth2ServerConfiguration.java

示例7: RestTemplate

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Autowired
public $NAME(@Value("${oauth2.tokenKey}") String publicKeyUrl) throws Exception {
    String publicKey = (String) new RestTemplate().getForObject(publicKeyUrl, Map.class).get("value");

    JwtAccessTokenConverter tokenConverter = new JwtAccessTokenConverter();
    tokenConverter.setVerifierKey(publicKey);
    tokenConverter.afterPropertiesSet();

    tokenStore = new JwtTokenStore(tokenConverter);
}
 
開發者ID:mkopylec,項目名稱:allegro-intellij-templates,代碼行數:11,代碼來源:$ Spring OAuth2 Access Token Decoder.java

示例8: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
/**
 * Apply the token converter (and enhander) for token store.
 */
@Bean
public JwtTokenStore tokenStore() throws UnrecoverableKeyException, CertificateException, NoSuchAlgorithmException,
    KeyStoreException, IOException {
    return new JwtTokenStore(jwtAccessTokenConverter());
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:9,代碼來源:UaaConfiguration.java

示例9: jwtTokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean(TokenStore.class)
public TokenStore jwtTokenStore() {
	return new JwtTokenStore(jwtTokenEnhancer());
}
 
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:6,代碼來源:ResourceServerTokenServicesConfiguration.java

示例10: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore(JwtAccessTokenConverter jwtTokenEnhancer) {
	return new JwtTokenStore(jwtTokenEnhancer);
}
 
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:5,代碼來源:ResourceServerTokenServicesConfigurationTests.java

示例11: jwtTokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
public TokenStore jwtTokenStore(){
    return new JwtTokenStore(this.jwtAccessTokenConverter());
}
 
開發者ID:TZClub,項目名稱:OMIPlatform,代碼行數:5,代碼來源:JwtSecurityConfig.java

示例12: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore(JwtAccessTokenConverter jwtAccessTokenConverter) {
    return new JwtTokenStore(jwtAccessTokenConverter);
}
 
開發者ID:xm-online,項目名稱:xm-ms-balance,代碼行數:5,代碼來源:MicroserviceSecurityConfiguration.java

示例13: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore() {
    return new JwtTokenStore(jwtTokenEnhancer());
}
 
開發者ID:andifalk,項目名稱:spring-authorization-server,代碼行數:5,代碼來源:JwtConfiguration.java

示例14: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore() {
	return new JwtTokenStore(jwtTokenEnhancer());
}
 
開發者ID:rhawan,項目名稱:microservices-tcc-alfa,代碼行數:5,代碼來源:AuthorizationServerConfiguration.java

示例15: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; //導入依賴的package包/類
@Bean
public TokenStore tokenStore(JwtAccessTokenConverter accessTokenConverter) {
	return new JwtTokenStore(accessTokenConverter);
}
 
開發者ID:codenergic,項目名稱:theskeleton,代碼行數:5,代碼來源:SecurityConfig.java


注:本文中的org.springframework.security.oauth2.provider.token.store.JwtTokenStore類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。