Back

Unable to get account details through GraphQL (server)

  • 0
  • Self Hosted
  • Accounts
  • GraphQL
  • Web
debashish
22 Oct, 2023, 05:57

I'm attempting to retrieve information about the currently authenticated user using a GraphQL query on the server. However, I'm encountering a "bad request" error with the message "(role: applications) missing scope (account)." This issue likely arises because I'm performing a server-side operation to fetch user account details, and Appwrite is unable to determine the specific user context for this operation. It seems that I need to include the JWT token from the client when making this query, but I never received a JWT token upon logging in.

TL;DR
- User is having trouble getting account details through GraphQL in Appwrite server. - They mention that the createJWT method is not meant for authentication and using an API key with the API call is incorrect. - User questions how Appwrite determines which user the JWT is associated with. - When attempting to retrieve information about the currently authenticated user using a GraphQL query, the user encounters a "bad request" error with the message mentioning missing scope (account). - User suspects that the issue is due to performing a server-side operation and Appwrite not being able to determine the user context. - User mentions not receiving a JWT token upon logging in. Solution
debashish
22 Oct, 2023, 06:22

I've noticed in documents there is a GraphQL query to create a JWT, but it doesn't specify the user(account) for whom the JWT is intended. This raises questions about how Appwrite determines which user(account) the JWT is associated with.

Drake
22 Oct, 2023, 21:11

As mentioned in https://discord.com/channels/564160730845151244/1165520670252351551/1165727790163828966, the createJWT is not meant for authentication.

role: applications

means you're using an API key, which shouldn't be used with whatever api call you're making.

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