Rank 1: Thread
Hello, so i tried adding my custom oauth server to the provider following https://github.com/appwrite/appwrite/blob/master/docs/tutorials/add-oauth2-provider.md#2-implement-new-provider and i was able to do it.
This doc i believe is outdated a little bit but figured it somehow.
1- So i set up my client in appwrite(check second comment)
1.1- docker compose build && docker compose up -d
2- go to http://localhost/v1/account/sessions/oauth2/kollektor with project id and the response format headers,
which redirects to the correct /authorize in my server then i login there
3- when login is complete and my server redirects to http://localhost/v1/account/sessions/oauth2/kollektor/redirect?project=6408533033ee5dbf1c1f&code=eyJhbG...&state={"success":"http:\/\/localhost\/auth\/oauth2\/success","failure":"http:\/\/localhost\/auth\/oauth2\/failure"}
4- Then i end up in page http://localhost/auth/oauth2/failure
Missing Redirect URL
Your OAuth login flow is missing a proper redirect URL. Please check the OAuth docs and send request for new session with a valid callback URL.
5- I check the logs of appwrite container:
appwrite | [Error] Timestamp: 2023-03-08T11:56:17+00:00
appwrite | [Error] Method: GET
appwrite | [Error] URL: /v1/account/sessions/oauth2/:provider/redirect
appwrite | [Error] Type: Appwrite\Extend\Exception
appwrite | [Error] Message: Missing ID from OAuth2 provider.
appwrite | [Error] File: /usr/src/code/app/controllers/api/account.php
appwrite | [Error] Line: 460
appwrite | [Error] Timestamp: 2023-03-08T11:56:18+00:00
appwrite | [Error] Method: GET
appwrite | [Error] URL: /v1/account
appwrite | [Error] Type: Appwrite\Extend\Exception
appwrite | [Error] Message: User (role: guests) missing scope (account)
appwrite | [Error] File: /usr/src/code/app/controllers/general.php
appwrite | [Error] Line: 365