use of org.springframework.security.oauth2.provider.token.DefaultTokenServices in project spring-boot by spring-projects.
the class ResourceServerTokenServicesConfigurationTests method asymmetricJwt.
@Test
public void asymmetricJwt() {
EnvironmentTestUtils.addEnvironment(this.environment, "security.oauth2.resource.jwt.keyValue=" + PUBLIC_KEY);
this.context = new SpringApplicationBuilder(ResourceConfiguration.class).environment(this.environment).web(WebApplicationType.NONE).run();
DefaultTokenServices services = this.context.getBean(DefaultTokenServices.class);
assertThat(services).isNotNull();
}
use of org.springframework.security.oauth2.provider.token.DefaultTokenServices in project spring-security-oauth by spring-projects.
the class TokenServicesWithTokenEnhancerTests method init.
@Before
public void init() throws Exception {
tokenServices = new DefaultTokenServices();
tokenServices.setClientDetailsService(new InMemoryClientDetailsServiceBuilder().withClient("client").authorizedGrantTypes(new String[] { "authorization_code", "refresh_token" }).scopes("read").secret("secret").and().build());
enhancer.setTokenEnhancers(Arrays.<TokenEnhancer>asList(jwtTokenEnhancer));
jwtTokenEnhancer.afterPropertiesSet();
tokenServices.setTokenStore(new JwtTokenStore(jwtTokenEnhancer));
tokenServices.setTokenEnhancer(enhancer);
}
use of org.springframework.security.oauth2.provider.token.DefaultTokenServices in project theskeleton by codenergic.
the class OAuth2ResourceServerConfig method configure.
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
DefaultTokenServices tokenServices = new DefaultTokenServices();
tokenServices.setAuthenticationManager(authenticationManager);
tokenServices.setTokenStore(tokenStore);
resources.tokenServices(tokenServices);
}
use of org.springframework.security.oauth2.provider.token.DefaultTokenServices in project faf-java-server by FAForever.
the class OAuthJwtConfig method tokenServices.
@Bean
@Primary
public DefaultTokenServices tokenServices(TokenStore tokenStore) {
DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore);
defaultTokenServices.setSupportRefreshToken(true);
return defaultTokenServices;
}
use of org.springframework.security.oauth2.provider.token.DefaultTokenServices in project FP-PSP-SERVER by FundacionParaguaya.
the class AuthServerOAuth2Config method defaultTokenServices.
@Bean
@Primary
public DefaultTokenServices defaultTokenServices() {
final DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore());
defaultTokenServices.setTokenEnhancer(tokenEnhancer());
defaultTokenServices.setSupportRefreshToken(true);
defaultTokenServices.setClientDetailsService(clientDetailsService());
return defaultTokenServices;
}
Aggregations