Closed scandella closed 8 months ago
Correct - we should be sending through the accessType = 'offline'
option to the authorization URL.
Fixed for the next release. To get this early, run composer require verbb/consume:"dev-craft-4 as 1.0.4"
You will need to disconnect and reconnect.
Thanks for your answer.
I've installed the beta version ('dev-craft-4'). I can see the options['access_type'] = 'offline';
in our Google.php file.
I've created a fresh Google client, but I see no change with the token expiration: delay is still one hour.
In the "auth_oauth_tokens" table, the "refreshToken' entry is still empty.
Best.
Ah, looks like you also need to include $options['prompt'] = 'consent'
as well. This tripped me up as this was shown the first time I connected, but subsequent connects didn't show the prompt, and that doesn't seem to allow a refresh token to be generated.
Fixed for the next release. To get this early, run composer require verbb/consume:"dev-craft-4 as 1.0.4"
Many thanks. It works now!
Describe the bug
I am able to work with Google Drive object using Consume, but after 1 hour, it errors out with exception: "The remote server returned an error: (401) Unauthorized." It seems that, by setting "access_type" to "offline", when a user consents to offline access a refresh token is returned that can be swapped (along with the client secret) at any time for an access token. Is this a settings that you can implement? Otherwise, connecting to Google Drive via Consume is not very helpful. Best
Steps to reproduce
Craft CMS version
Craft 4.5.11.1
Plugin version
1.0.4
Multi-site?
No
Additional context
No response