Back

Discord OAuth returns invalid_client no description error

  • 0
  • Auth
  • Web
  • Cloud
NickTheMusketeer
21 Nov, 2024, 21:56

I am attempting to integrate with Discord's OAuth. So far I have;

  1. Created a Discord app and added my Appwrite's project redirect URI
  2. I enabled Discord OAuth in Appwrite Auth and provided the App ID and App Secret
  3. When I attempt to call the createOAuth2Session it works in the sense that I reach the Discord OAuth confirmation page and I click Authorise
  4. Once I get redirected back to my app (http://localhost:3000), I get the following error:

{"message":"Failed to obtain access token. The Discord OAuth2 provider returned an error: invalid_client: No description","type":"user_oauth2_unauthorized","code":401}

I'm not sure I understand where the problem seems to be and invalid_client lacking description makes it harder to debug.

TL;DR
Issue with Discord OAuth integration in Appwrite Cloud. When trying to edit Discord OAuth2 settings, the App ID changes to the Cloud email. Upon redirect back to the app after authorizing, the error "invalid_client: No description" occurs. Solution: Ensure that the correct App ID and App Secret are provided when enabling Discord OAuth in Appwrite Auth. Check the redirect URI and confirm that it matches the one set in the Discord app. If the issue persists, contact Appwrite support for further assistance.
NickTheMusketeer
21 Nov, 2024, 21:58

A side effect I noticed on the Appwrite Cloud platform is that when I try to "Edit" the Discord OAuth2 settings in the modal, the App ID flickers for a second and the input field assumes my Appwrite Cloud email instead of the supplied App ID.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more