My current OAuth2 configuration doesn't return refresh token. My configuration is as basic as possible. How can I configure it so that it would return refresh_token as well. I'm authenticating user on the server side. So JS solutions don't work.
I need the refresh token for RememberMe functionality. Specifically I'm using oAuth2AuthorizedClientService.loadAuthorizedClient(clientId, principalName); method, to get access to the information that was retrieved from googles authentication server.
WebSecurityConfigurerAdapter {
...
httpSecurity
...
.and()
.oauth2Login()
.and()
.rememberMe()
...
Application.yml:
security:
oauth2:
client:
registration:
google:
clientId: ZZZ
clientSecret: zzzz
redirectUri: https://example.com/login/oauth2/code/google