akeeba / sociallogin

Joomla!™ login and user account creation with Facebook, Google, GitHub etc social media accounts
30 stars 10 forks source link

Error code 400 received requesting access token: {"error":{"message":"This authorization code has been used." [OTHER] #102

Closed mubmart7 closed 1 year ago

mubmart7 commented 1 year ago

I get this error even though with facebook login even though everything works fine. The account is created and able to login with facebook but this error message keep coming on every login and account creation: Warning Error code 400 received requesting access token: {"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100,"error_subcode":36009,"fbtrace_id":"A2g_El2BqBea55Zlkkf0LnA"}}.

What could be the problem?

I tried to reset the client token but the message persists.

Facebook error
mubmart7 commented 1 year ago

It happens to Google as well. So I guess it has nothing to do with Facebook: Warning Error code 400 received requesting access token: { "error": "invalid_grant", "error_description": "Bad Request" }.

Screenshot 2023-08-07 at 14-41-31 Workforce Database System

nikosdion commented 1 year ago

It has nothing to do with our software either.

I have tested this and found it working right on a local server, an Ubuntu Server, and a site on public hosting (Rochen).

Based on your error message and the fact that you get this on two different plugins, your host is caching the request being sent from your server to Facebook, Google, etc.

mubmart7 commented 1 year ago

Just realised the cause is the Redirect after Login. Once disabled, it works fine.

But also the JCH Optimise system plugin disables the buttons.

nikosdion commented 1 year ago

You should no longer be using JCH Optimise or anything similar on Joomla 4.

Joomla 4 native extensions use the WebAssetManager to load their JavaScript deferred. This plugin —and all similar solutions— mess this up, making the JavaScript load at the wrong time, therefore breaking your site.