Back

[SOLVED] Google oauth succeeds, but fails to retrieve account - 401 response

  • 0
  • Flutter
  • Accounts
bugs_cena
23 Aug, 2023, 17:47

The same works fine for both Web and iOS but fails on Android with the following error:

TypeScript
[Error] Method: GET
[Error] URL: /v1/account
[Error] Type: Appwrite\Extend\Exception
[Error] Message: User (role: guests) missing scope (account)

I have configured the callback url in AndroidManifest.xml. Added a platform for the android. Looks like the cookies are not being sent. The request object seems to contain all the cookies, but the request instance in the incoming response object doesn't have them. Am I missing something w.r.t configuration?

TL;DR
I had an issue with Google oauth succeeding but failing to retrieve the account with a 401 response error. It turns out the problem was that I had configured the wrong scheme (`http` instead of `https`) for the client endpoint. The same process works fine for Web and iOS, but not for Android. The error message indicated that the user was missing the scope (account). I have already configured the callback URL in my AndroidManifest.xml and added a platform for Android. It seems that the cookies are not being sent properly. The request object shows that all the cookies are there, but the incoming response object does not have them. I
Drake
23 Aug, 2023, 20:10

How many instances of client do you have in your app?

bugs_cena
24 Aug, 2023, 18:02

I realized that this was an issue with wrongly configured scheme http vs https for client endpoint.

Drake
24 Aug, 2023, 18:36

[SOLVED] Google oauth succeeds, but fails to retrieve account - 401 response

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