0

I got basic profile info permission from a user through my google app. And now i newly added "access_type=offline" in the api call. It will prompt the user in consent screen like "Have offline access". How do i avoid this screen and get automatically offline access from user without consent screen.

My api call:

https://accounts.google.com/o/oauth2/auth?client_id=CLIENTID&redirect_uri=REDIRECTURI&scope=email+profile+https://www.googleapis.com/auth/drive.readonly&response_type=code&access_type=offline&state=12345678909876543

in the above url i added access_type=offline newly. So it display a consent screen like "Have Offline Access". help me to get offline access from user without prompting the consent screen while user clicks my google app from their account.?

Thanks in advance.

1
  • 2
    You want to access the user's Google resources without them giving you their consent??? Hopefully it's obvious why that's impossible. Commented Apr 23, 2017 at 7:44

1 Answer 1

2

It is not possible to get offline access without user consent.

But maybe you don't need offline access. When you have an administator install your app through gsuite marketplace, you can use a service account to do stuff in the users drive by impersonating. That way you don't need each user of your domain to give consent.

Be aware that you cannot use the service account for everything. For instance: you cannot impersonate a user and than call an appscript script.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks alex. I Don't need that administrator settings because i'm not going to publish my app as a domain-wide one. I am going to publish a app which takes google drive permission from user while installing and i save the refreshtoken in myside. After some time if user wants to send a report data as pdf into his google drive through my product website i use that refresh token and created accesstoken in offline and send it to user drive. That's why i need offline access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.