• Resolved leocunha

    (@leocunha)


    Hi,

    I have used the correct client id and key but I keep getting this message: Google Photos Refresh Token invalid. Please authenticate from Photonic → Authentication. See here for documentation. O have created new keys but all return the same error.

    Thank you!

Viewing 15 replies - 1 through 15 (of 32 total)
  • Thread Starter leocunha

    (@leocunha)

    I’m trying to do the workaround but get the same error. Google Photos Refresh Token invalid. Please authenticate from Photonic → Authentication

    I have redone every step. The plugin authentication seems to be worked, but I keep getting this invalid token message. I have disabled the cache plugin, cleaned the caches, tested with 3 different browsers…

    • This reply was modified 4 years, 1 month ago by leocunha.
    Thread Starter leocunha

    (@leocunha)

    Also, when I try to create a new shortcode to show the gallery, the add/edit photonic window returns the error 401.

    I tried with web application and desktop id. With web application, I get the errors described above. With the desktop ID, I can’t authenticate and get error 400.

    • This reply was modified 4 years, 1 month ago by leocunha.
    Plugin Author Sayontan Sinha

    (@sayontan)

    I thought your site was working fine. Why did you have to regenerate tokens?

    If it was working in the past and it suddenly stopped working, the root cause is generally something else on your site, like another plugin or a configuration change by your hosting provider.

    Thread Starter leocunha

    (@leocunha)

    Hi,

    It’s a new website. The other one is fine. The plugin never worked here. I did not regenerate anything; I’m getting that error since the first time I tried.

    Thanks.

    • This reply was modified 4 years, 1 month ago by leocunha.
    Plugin Author Sayontan Sinha

    (@sayontan)

    My response is still the same – the root cause is one of the following:

    • Disabling of HTTPS calls by the hosting provider
    • A security plugin that strips out some authentication credentials.
    • A cURL timeout issue or the disabling of some cURL features by the hosting provider.

    If you are able to rule out the above, please try the following steps:

    1. Create a post with the following shortcode:
      [gallery type='google' view='albums']
      I am assuming that your shortcode is gallery. If not, substitute gallery with whatever your shortcode is.
    2. Save the post and let me know what the URL is.

    This will hopefully give me more details regarding your error message.`

    Thread Starter leocunha

    (@leocunha)

    I will try the post but it’s weird as:

    This website is hosted in the same VPS of my other one that works fine with Photonic.

    I deactivated Worldfence and nothing changed. I’m also using this plugin with my other website that the authentication works fine.

    Thread Starter leocunha

    (@leocunha)

    Here is the post url: https://xcnorth.au/testing-photonic/
    Do you think it’s worth removing the plugin and installing it again?

    Hostgator informed me that they are not blocking anything. I have also disabled almost all plugins. They suggested a plugin called SSL Insecure Content Fixer but it does not change anything.

    Thanks.

    • This reply was modified 4 years, 1 month ago by leocunha.
    • This reply was modified 4 years, 1 month ago by leocunha.
    Plugin Author Sayontan Sinha

    (@sayontan)

    Do you think it’s worth removing the plugin and installing it again?

    No. The plugin is not at fault here. No matter how you try modifying things with Photonic, there will be no difference. Basically this is the flow of the plugin:

    1. Once you have installed the plugin and saved the client id and client secret, those settings are used for authentication.
    2. Google’s authentication is a 2-step authentication. In the first step (where you use the Authentication page of Photonic), the plugin uses your credentials and fetches a refresh token. If the authentication screen successfully displays a refresh token, it means that your authentication was successful. This refresh token is saved in the plugin’s options.
    3. The second part of the authentication comes into effect on the front-end (and the gallery wizard). Here, the saved refresh token is used, and the plugin, on the fly, uses it to get a short-lived access token. This is the step that is failing for you. In a real-world scenario, this can only fail in two cases: first, either you have gone to Google and de-authorized the refresh token, or second, the refresh token has been edited manually by you.
    4. The first case in the above point occurs if you are editing things within your Google preferences (which is not happening here). The second case occurs only if either another plugin is messing with the refresh token, or for some reason the refresh token is not being picked up at all. When you go to Photonic → Settings → Google Photos → Refresh Token (for Back-end / Server-side Authentication), do you see your token filled out there? If it is filled out, then the only possibility that remains is that something else on your site is interfering with Photonic.

    I didn’t notice this previously:

    I’m trying to do the workaround but get the same error. Google Photos Refresh Token invalid. Please authenticate from Photonic → Authentication

    Did your authentication complete without errors the first time? Meaning, did the authentication screen provide you with a refresh token? If so, you wouldn’t need the workaround.

    It’s a new website. The other one is fine. The plugin never worked here. I did not regenerate anything; I’m getting that error since the first time I tried.

    Is it the same Google user or a different one? For the purpose of testing, can you try copying the client id, client secret and refresh token from your other site into the fields of this one? Don’t authenticate after you have done so, but simply try to see if the photos / albums for that user are showing up here. If they are showing up, then there is a problem with the refresh token that Google is issuing. If they don’t show up, then there is a problem with your website.

    Thread Starter leocunha

    (@leocunha)

    Did your authentication complete without errors the first time? Meaning, did the authentication screen provide you with a refresh token? If so, you wouldn’t need the workaround.

    I tried with the Desktop app option but got the error 400 so I changed it to Web application. This time the authentication failed again so I did the workaround and put the new refresh key created on the Google Playgroung, but the problem is the same. The authentication went well only after the workaround. I clicked on the Obtain Token button and it worked.

    Yes, I have a refresh key on the respective field.

    It’s a new website with a different google account.

    For the purpose of testing, can you try copying the client id, client secret and refresh token from your other site into the fields of this one? Don’t authenticate after you have done so, but simply try to see if the photos / albums for that user are showing up here.

    I did what you asked but the problem is the same: “Google Photos Refresh Token invalid. Please authenticate from Photonic”.

    Thanks

    • This reply was modified 4 years, 1 month ago by leocunha.
    • This reply was modified 4 years, 1 month ago by leocunha.
    Thread Starter leocunha

    (@leocunha)

    And when I use the Add/edit gallery, I get this error: https://pasteboard.co/chWYdkgFiSlz.png

    I ran another test. I have another website, so I created a new post, put the shortcode, and it works. (tested here: https://leocunha.com.br/test/)

    I have noticed that the other website works and shows the Google Album. The new website I’m trying to use Photonics shows the authentication problem and something else on the Elementor backend. Please, check the image below. Even calling for a [gallery type='google' view='albums'] it shows my WP gallery. https://pasteboard.co/kDr3ea2pmaRK.png

    The other website uses the same Theme, and most plugins are the same. The one with the issue uses Worldfence and WP Super Cache (bot deactivated), but I have been using Worldfence + Photonic with no issues. Is it possible to track what is causing this???

    Plugin Author Sayontan Sinha

    (@sayontan)

    I did what you asked but the problem is the same: “Google Photos Refresh Token invalid. Please authenticate from Photonic”.

    As stated in my previous post, this can be confirmed to be a problem with your website or other plugins, and I don’t have any suggestions on how you can solve it.

    And when I use the Add/edit gallery, I get this error: https://pasteboard.co/chWYdkgFiSlz.png

    This is inconsequential – it is coming because of the issue with the token.

    I have noticed that the other website works and shows the Google Album. The new website I’m trying to use Photonics shows the authentication problem and something else on the Elementor backend. Please, check the image below. Even calling for a [gallery type='google' view='albums'] it shows my WP gallery. https://pasteboard.co/kDr3ea2pmaRK.png

    I cannot access the link. You can try using a different shortcode (Photonic → Settings → Generic Options → Generic Settings → Custom Shortcode) – that will not pull the WP gallery images, but the issue with the token will still continue, unless whatever it is that is interfering with the token is actually tracking the gallery shortcode.

    The other website uses the same Theme, and most plugins are the same. The one with the issue uses Worldfence and WP Super Cache (bot deactivated), but I have been using Worldfence + Photonic with no issues.

    There is no conflict between Wordfence and Photonic. I use it on one of my sites. You can try deactivating all plugins and switching to the default theme. If the problem still persists, there might be some security setting enforced by your host. Have you tried contacting your host as per my first suggestion?

    Is it possible to track what is causing this???

    Not for me – sorry. If you have a developer, that person might be able to run some debugging checks to see what is going on.

    Thread Starter leocunha

    (@leocunha)

    Have you tried contacting your host as per my first suggestion?

    Hi, yes, they said there is nothing blocking this request.

    I cannot access the link. You can try using a different shortcode (Photonic → Settings → Generic Options → Generic Settings → Custom Shortcode) – that will not pull the WP gallery images, but the issue with the token will still continue, unless whatever it is that is interfering with the token is actually tracking the gallery shortcode.

    I changed the shortcode but have the same issue…

    Plugin Author Sayontan Sinha

    (@sayontan)

    So, since your host says it has no specific security configuration, it looks like you are out of options.

    Thread Starter leocunha

    (@leocunha)

    I am… I reinstalled the plugin, and did the authentication again, which is working as I can see the gallery when using another website to pull the photos. It doesn’t make any sense! It’s a very simple website with only 2 pages.

    Thread Starter leocunha

    (@leocunha)

    From Hostgator:

    I really want to help you on this matter that is why I utilize all of my resources. I was able to replicate the error that you are getting however there is no indication of a problem with cURL (or else the health dashboard would report it) or a security plugin at work, and even disabling the firewall doesn’t have any effect. The Google login page shows a problem with the request, but it isn’t more specific as to what that is.

    I suggest to contact the plugin developer to get more details on what issues with google has with the request since the google provides error details that say they should be given to the developer of the plugin. If they can provide a more detailed error on their end or configuration as why the authentication fails, and can make recommendations, we can try to act on those recommendations.
    As of this moment, all we have is that the request doesn’t conform with Google’s Oauth policy (and Oauth 2.0 is installed already), so it’s not clear why that is breaking down`

    I suggest to take this with the plugin developer so he can provide a detailed analysis that you can provide us so we can explore more. Because we already check the server and configurations there is no error

Viewing 15 replies - 1 through 15 (of 32 total)

The topic ‘Google Photos Refresh Token invalid’ is closed to new replies.