I am trying to integrate Google OAuth 2 using Spring Security. Everything works well, but refresh_token is null.
Here is my config:
@Bean
public OAuth2ProtectedResourceDetails googleOAuth2Details() {
AuthorizationCodeResourceDetails googleOAuth2Details = new AuthorizationCodeResourceDetails();
googleOAuth2Details.setAuthenticationScheme(form);
googleOAuth2Details.setClientAuthenticationScheme(form);
googleOAuth2Details.setClientId(googleClientId);
googleOAuth2Details.setClientSecret(googleClientSecret);
googleOAuth2Details.setUserAuthorizationUri(googleOAuthUri);
googleOAuth2Details.setAccessTokenUri(googleTokenUrl);
googleOAuth2Details.setScope(asList("openid","email"));
return googleOAuth2Details;
}
I read that in order to get refresh_token, access_type has to be "offline". But what is the way to set it in Spring?
Aucun commentaire:
Enregistrer un commentaire