How to set expire_in in OAUTH 2.0?

后端 未结 8 2056
醉梦人生
醉梦人生 2020-12-28 15:58

I am using OAuth 2.0 with spring for token generation and I want to set expire_in manually so token can expire as per my criteria. Any one help me?

8条回答
  •  甜味超标
    2020-12-28 16:29

    If you are using grails security oauth2 provider you can only change grails-app/conf/spring/resources.groovy

    import org.springframework.security.oauth2.provider.token.DefaultTokenServices
    
    // Place your Spring DSL code here    
    
    beans = {
    
      tokenServices(DefaultTokenServices){
        accessTokenValiditySeconds =  600;
        tokenStore = ref('tokenStore')
        supportRefreshToken = true;
        clientDetailsService = ref('clientDetailsService')
      }
    
    }
    

提交回复
热议问题