@Bean
 @Primary
 public DefaultTokenServices tokenServices() {
   final DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
   defaultTokenServices.setTokenStore(tokenStore());
   return defaultTokenServices;
 }
 @Bean
 public DefaultTokenServices tokenServices() {
   DefaultTokenServices tokenServices = new DefaultTokenServices();
   tokenServices.setTokenStore(tokenStore());
   tokenServices.setClientDetailsService(clientDetailsService());
   return tokenServices;
 }
 @Bean
 @ConditionalOnMissingBean(ResourceServerTokenServices.class)
 public ResourceServerTokenServices jwtTokenServices() {
   DefaultTokenServices services = new DefaultTokenServices();
   services.setTokenStore(jwtTokenStore());
   return services;
 }
 @Bean
 public ResourceServerTokenServices tokenServices() {
   final DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
   defaultTokenServices.setTokenEnhancer(jwtTokenEnhancer());
   defaultTokenServices.setTokenStore(tokenStore());
   return defaultTokenServices;
 }
 @Bean
 @Primary
 public DefaultTokenServices tokenServices() {
   DefaultTokenServices tokenServices = new DefaultTokenServices();
   tokenServices.setSupportRefreshToken(true);
   tokenServices.setTokenStore(this.tokenStore);
   return tokenServices;
 }
 @Bean
 public DefaultTokenServices tokenServices() {
   DefaultTokenServices services = new DefaultTokenServices();
   services.setClientDetailsService(clientDetailsService);
   services.setSupportRefreshToken(true);
   services.setTokenStore(new InMemoryTokenStore());
   return services;
 }
 @Bean
 @Primary
 public DefaultTokenServices tokenServices() {
   DefaultTokenServices tokenServices = new DefaultTokenServices();
   tokenServices.setSupportRefreshToken(true);
   tokenServices.setTokenStore(getTokenStore());
   tokenServices.setTokenEnhancer(tokenEnhancer());
   return tokenServices;
 }
 @Bean
 public DefaultTokenServices tokenServices(
     InMemoryTokenStore tokenStore, ClientDetailsService jpaUserCredentialsService) {
   DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
   defaultTokenServices.setTokenStore(tokenStore);
   defaultTokenServices.setSupportRefreshToken(true);
   defaultTokenServices.setClientDetailsService(jpaUserCredentialsService);
   return defaultTokenServices;
 }
  public ResourceOwnerPasswordTokenGranterTests() {
    String clientId = "client";
    BaseClientDetails clientDetails = new BaseClientDetails();
    clientDetails.setClientId(clientId);

    providerTokenServices.setTokenStore(new InMemoryTokenStore());
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("username", "foo");
    parameters.put("password", "bar");
    parameters.put("client_id", clientId);

    tokenRequest = requestFactory.createTokenRequest(parameters, clientDetails);
  }
 public TestAuthorizationCodeTokenGranter() {
   providerTokenServices.setTokenStore(new InMemoryTokenStore());
 }