Back

OAuth2 using Rest

  • 0
  • Self Hosted
  • Accounts
  • Web
  • REST API
fafa
1 Mar, 2024, 20:19

Heyo!

Does someone have a working way for OAuth2 using REST? I am struggling to get it to work, for example using the discord oauth, I am getting:

TypeScript
Request header field x-appwrite-response-format is not allowed by Access-Control-Allow-Headers in preflight response.
TL;DR
Developers are having trouble with OAuth2 using Rest in the Appwrite SDK for the web. The `account.createSession` function is outdated and causing issues. The solution is to refer to the SDKs for guidance since the documentation is limited. For OAuth2 using REST, developers are supposed to redirect the user to a specific URL (https://appwrite.io/docs/references/cloud/client-rest/account#createOAuth2Session). There are also CORS issues with Discord OAuth due to a preflight response error.
Steven
1 Mar, 2024, 20:22

you're supposed to redirect the user to that URL

fafa
1 Mar, 2024, 20:25

So that's exactly what I am doing

fafa
1 Mar, 2024, 20:28

There's also nothing else in the docs about this, it's very empty, so I don't know where to send the user to

Steven
1 Mar, 2024, 20:32

tip: refer to the SDKs

fafa
1 Mar, 2024, 20:59

it doesn't say enough for me though, that's what the docs say and I am doing, also this is also outdated: https://appwrite.io/docs/products/auth/oauth2 account.createSession doesn't seem to exist :/

fafa
1 Mar, 2024, 21:00
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