Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In spring security oauth, What is the default duration of refresh token?

What is the default duration of the oauth refresh token in a spring application?

I want to know the default value, so we don't have to set the value ourselves or provide a parameterized ClientDetailsServiceConfigurer.

like image 562
dovahkiin Avatar asked Sep 11 '25 08:09

dovahkiin


1 Answers

Found it in the source code after all:

The resource token is valid for 30 days:

private int refreshTokenValiditySeconds = 60 * 60 * 24 * 30; // default 30 days.

The accessToken is valid for 12 hours:

private int accessTokenValiditySeconds = 60 * 60 * 12; // default 12 hours.


OLD ANSWER:

I don't know from the top of my head but you can easily find out using the getAccessTokenValiditySeconds(); method as mentioned in the documentation.

like image 153
Rick van Lieshout Avatar answered Sep 13 '25 22:09

Rick van Lieshout