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


Java JwtAccessTokenConverter.afterPropertiesSet方法代码示例

本文整理汇总了Java中org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter.afterPropertiesSet方法的典型用法代码示例。如果您正苦于以下问题:Java JwtAccessTokenConverter.afterPropertiesSet方法的具体用法?Java JwtAccessTokenConverter.afterPropertiesSet怎么用?Java JwtAccessTokenConverter.afterPropertiesSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter的用法示例。


在下文中一共展示了JwtAccessTokenConverter.afterPropertiesSet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; //导入方法依赖的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.JwtAccessTokenConverter; //导入方法依赖的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: symmetricTokenConverter

import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; //导入方法依赖的package包/类
@Bean
@Primary
@Profile("OAuth2ConfigurationTest")
public JwtAccessTokenConverter symmetricTokenConverter(
    DefaultAccessTokenConverter defaultAccessTokenConverter) throws Exception {
  JwtAccessTokenConverter jwtAccessTokenConverter = new JwtAccessTokenConverter();
  jwtAccessTokenConverter.setAccessTokenConverter(defaultAccessTokenConverter);
  jwtAccessTokenConverter.afterPropertiesSet();
  return jwtAccessTokenConverter;
}
 
开发者ID:cloudfoundry-incubator,项目名称:credhub,代码行数:11,代码来源:OAuth2AuthConfigurationTest.java

示例4: accessTokenConverter

import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; //导入方法依赖的package包/类
@Bean
public JwtAccessTokenConverter accessTokenConverter() throws Exception {
	JwtAccessTokenConverter jwt = new JwtAccessTokenConverter();
	jwt.setSigningKey(signing);
	jwt.setVerifierKey(verifier);
	jwt.afterPropertiesSet();
	return jwt;
}
 
开发者ID:timtebeek,项目名称:resource-server-testing,代码行数:9,代码来源:AuthorizationServerConfig.java

示例5: RestTemplate

import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; //导入方法依赖的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

示例6: tokenStore

import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; //导入方法依赖的package包/类
@Bean
public JwtTokenStore tokenStore() throws Exception {
	JwtAccessTokenConverter enhancer = new JwtAccessTokenConverter();
	enhancer.afterPropertiesSet();
	return new JwtTokenStore(enhancer);
}
 
开发者ID:sdeeg-pivotal,项目名称:spring-polymer-demo,代码行数:7,代码来源:PolymerResourceOAuthConfig.java


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