简体   繁体   中英

Google Oauth implementation on application login every time asking for permission to “Have offline access”, why?

My application is prompting each time for having offline access. Could you please help me how to configure this. Lets say i have implemented for an application login. in that case asking for offline access each time.

It should ask only for the first time, Next time onwards it should just login. Please let me know if i have to do some configuration for this.

Am using google-api-java-client Library. 1.17.0 version google-api-java-client Library. 1.17.0 version

Thanks in advance.

I don't know your login url, but I assume, that you are either still using the offline scope or approval_promt=force. Remove them both from your url, if you don't want the user getting prompted.

The problem: you don't know, if you already got a refresh token, so what you're going to want to do is, that you first log the user in, then check, if you need a refresh token and then redirect the user again to google with the right scope.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM