Skip to content
Back

apple exchange code to token

  • 0
  • Web
  • Apple
  • REST API
shokarta
14 Dec, 2024, 13:56

hello guys, im new here πŸ™‚ I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form https://appleid.apple.com/auth/authorize with no problem, and i want to use curl/xmlhttprequest to exchange the code for token via appwrite endpoind.... so i did it via: curl -X POST 'https://cloud.appwrite.io/v1/account/sessions/oauth2/apple' \ -H 'Content-Type: application/json' \ -H 'X-Appwrite-Project: 675c7d58001___944f67' \ -d '{ "projectId": "675c7d58001___944f67", "code": "c2fb5ff8dbf1844b9933c740a4e5c39d8.0.mzvu.IykmGUmzM3qdzhvsYxpwNw", "success": "https://google.com", "failure": "https://bing.com" }' but it only returns: {"message":"The requested route was not found. Please refer to the API docs and try again.","code":404,"type":"general_route_not_found","version":"1.6.1"} and i dont know whats wrong, how to help, what to check 😦 do I need to somehow create session with me loging into appwrite.io so then when i try to use this apple endpoint, then i already have session with appwrite.io?

TL;DR
Developers setting up Apple OAuth need to exchange the code for a token. Make sure to set the correct endpoint, headers, and data in your curl request. The error message indicates a 404 route not found, possibly due to incorrect endpoint or data. Double-check your configurations and consult the API documentation. Additionally, logging into appwrite.io before using the Apple endpoint may help establish the necessary session.
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