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