OAuth2 Authentication Failure: CSRF Detected Error

Hi,
I’m experiencing an issue logging into my Discourse instance using OAuth2 authentication. Users attempting to log in are shown the following error message:

It appears to be related to a CSRF token validation failure during the OAuth2 callback phase.

I’ve checked:

• Browser cookies and sessions

• Ensured the OAuth2 settings and callback URLs are configured correctly

However, the issue persists, causing login attempts to consistently fail.

Could anyone please help me understand why this error is occurring and how to resolve it?

Thanks in advance for your assistance!

1 Like