Summary
I am trying to authenticate my spring boot application through google. I do not see any option to set access_type=offline to get the refresh token from google.
Actual Behavior
Expected Behavior
Configuration
Version
I am using 5.1.1 version
Sample
Comment From: jgrandja
@santhoshgs Have you seen the reference doc for customizing the Authorization Request?
...ability to customize the Authorization Request with additional parameters above the standard parameters defined in the OAuth 2.0 Authorization Framework.
This will explain how you can add the additional custom parameter access_type=offline to the Authorization Request.
I believe this is what you are asking?...although the information you provided is minimal. In the future, if you have a question or need help with a specific topic, please search for an answer on StackOverflow first. Our preference is to keep GitHub issues for bug reports or new feature and enhancement requests.
Comment From: santhoshgs
thank you , this helped me. i was able to resolve my issue.
Comment From: karlovskiy
In fresh spring versions (5.5.x+) if additional request parameter is always the same for a specific provider, for example prompt=consent or access_type=offline, you can set the in the authorizationUri in the config:
spring:
security:
oauth2:
client:
provider:
google:
authorization-uri: https://accounts.google.com/o/oauth2/v2/auth?prompt=consent&access_type=offline