Back

Authentik OAuth2 missing scope (account)

  • 0
  • Accounts
SenZi
1 May, 2023, 18:02

Hi, I am trying to use Authentik for OAuth2, but after successful redirection i get the error: missing scope (account)

TL;DR
The user is experiencing an issue with Authentik OAuth2, specifically a missing scope (account). They mention that adding HTTPS=true in the React JS start script seemed to fix the problem. They also suggest that if HTTPS is not possible on the front end, they can try accessing Appwrite without HTTPS. Additionally, they ask for tips on HTTPS support and mention editing the hosts file to map the local IP to the domain. They note that using account.get() is faster than account.getSession('current') and ask if running a server-side or just frontend code makes a difference. They clarify that the domain has been added as a web platform.
SenZi
1 May, 2023, 18:03

I have the AppWrite Instance on faw.domain.com and the frontend app on myaccount.domain.com (via hosts file)

Binyamin
1 May, 2023, 18:06

After success redirect get the user session with account.get() Then every request will be made on behalf of the user

SenZi
1 May, 2023, 18:07

Oh, I was currently using account.getSession('current');

SenZi
1 May, 2023, 18:07

to check if the user is authenticated

SenZi
1 May, 2023, 18:07

does that make a difference?

Binyamin
1 May, 2023, 18:08

I think

SenZi
1 May, 2023, 18:08

Just tried account.get(), same issue AppwriteException: User (role: guests) missing scope (account)

SenZi
1 May, 2023, 18:09

There is something to do about both the appwrite instance and the app being on the same domain right? does https make a difference? the web app is using http for development

Binyamin
1 May, 2023, 18:10

If you added the domain as a web platform then it's okay

Binyamin
1 May, 2023, 18:11

Do you run any server side or just from end code?

Drake
1 May, 2023, 18:11

yes i think that makes a difference.

Drake
1 May, 2023, 18:11

not for access-wise, but account.get() is faster than account.getSession('current')

SenZi
1 May, 2023, 18:13

oh, any tips on https support, i currently edited the hosts file to map local ip to the domain

Drake
1 May, 2023, 18:13

if you can't get HTTPS on your front end, you can try accessing appwrite without https

SenZi
1 May, 2023, 18:16

oh, its currently setup to redirect to https , now it might need extra configuration...

SenZi
1 May, 2023, 18:37

Fixed the issue, adding HTTPS=true in react js start script did something ig

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