Back

[SOLVED] OAuth2 flutter web, gives exception role: guests missing scope (account)

  • 0
  • Self Hosted
  • Flutter
  • Users
  • Accounts
Samiullah
6 Dec, 2023, 12:22

I am trying to use Oauth2 to authenticate users i am using keycloak oidc and flutter. Well it does create session in keycloak and creates user in appwrite but when i try to get account/user details it gives the exception that role: guests... What should i do?

Attaching code snippet

TL;DR
[SOLVED] The issue was resolved by self-hosting Appwrite on a local server instead of another IP. There may have been some custom domain issues. Another solution suggested was to clear cookies. The error occurred when trying to get the account details. The problem could be related to third-party cookies, so enabling them or using a custom domain in production is recommended.
Drake
6 Dec, 2023, 12:25

This might be a 3rd party cookie problem. In production, you'll need to have a custom domain. Locally, you can try to enable 3rd party cookies.

You can search around discord for similar threads.

Samiullah
6 Dec, 2023, 12:29

Well i am using organizational domain you know everything internally, in house servers and stuff

Samiullah
6 Dec, 2023, 12:30

Its under development yet

Drake
6 Dec, 2023, 12:30

Doesn't matter.

Samiullah
6 Dec, 2023, 12:31

Okay lemme check,

Samiullah
6 Dec, 2023, 13:13

Enabled third party cookies but same problem 🙂

Samiullah
6 Dec, 2023, 14:48

@Maniac_Fighter

D5
6 Dec, 2023, 15:00

Please, it's not recommended to pin people as it could be disruptive for them 😅

D5
6 Dec, 2023, 15:01

Where are you getting the error? While trying to get the account?

Samiullah
6 Dec, 2023, 16:05

Ohhh my bad sorry abt that, its on future result whera i am trying to get account

Drake
6 Dec, 2023, 16:12

Can you try clearing your cookies?

Samiullah
8 Dec, 2023, 04:19

Tried it too, still same problem

Samiullah
8 Dec, 2023, 06:27

Solved, when i tried to self host appwrite on local it worked as earlier i hosted it on another IP, so i guess there are some custom domain issues and stuff will check it and try again.

D5
8 Dec, 2023, 09:22

[SOLVED];OAuth2 flutter web, gives exception role: guests missing scope (account)

D5
8 Dec, 2023, 09:22

[SOLVED] OAuth2 flutter web, gives exception role: guests missing scope (account)

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