title: Spring security oauth 2 client app can't check token validity
body: <p>here is what I'm trying to achieve : </p>
  
  <p>I have an enterprise oauth 2 provider, I want to use their login form and get code, access token and so on from this provider </p>
  
  <p>here is my conf </p>
  
  <pre><code>security:
    oauth2:
      client:
        clientId: MY_CLIENT_ID
        clientSecret: asecret
        accessTokenUri: https://blabla/oauth-server/oauth/token
        userAuthorizationUri:  https://blabla/oauth-server/oauth/authorize
        tokenName: access_token
        scope : read
        userInfoUri: https://localhost/user
  </code></pre>
  
  <p>I can get my code which is changed for an access token, everything is fine, it's calling my local endpoint to get user information (roles for instance)</p>
  
  <p>but when I debug the code I can't see any expires_in value anywhere and my token doesn't expire at all. </p>
  
  <p>here's my resource server conf </p>
  
  <pre><code>@EnableResourceServer
  @EnableOAuth2Sso
  @RestController
  public class SecurityController extends ResourceServerConfigurerAdapter {
  
      private static final String RESOURCE_ID = "my_rest_api";
  
  
      @Override
      public void configure(ResourceServerSecurityConfigurer resources) {
          resources.resourceId(RESOURCE_ID).stateless(true);
      }
  
      @Override
      public void configure(HttpSecurity http) throws Exception {
          http.requestMatchers().anyRequest().and().authorizeRequests();
          http.
                  anonymous().disable()
                  .requestMatchers().antMatchers("/**/*")
                  .and().authorizeRequests()
                  .antMatchers("/**/*").access("#oauth2.hasScope('read')")
                  .and().exceptionHandling().accessDeniedHandler(new OAuth2AccessDeniedHandler());
      }
  }
  </code></pre>
  
  <p>I can't fidn out how to revoke the token </p>
  
  <p>any idea is welcome, i've lost a bunch of hour reading tutorials ... </p>