Skip to content
Back

external server get JWT user roles

  • 0
  • Self Hosted
  • Web
  • Cloud
raffel
17 Apr, 2024, 02:24

Hi, I have an external (Yjs) server that I want to use Appwrite's auth with. Specifically I want to read a user's roles/labels and allow access if a given role is set. I see I can use JWTs (as the user is authenticated on the web), but how would I go about getting the user from the JWT (and then the user's roles) on my own server?

TL;DR
Developers are trying to get user roles from a JWT on an external server. They can call account.get() on the server when authenticated with JWT. To achieve this, they need to decode the JWT and extract user information, including roles, for authorization.
raffel
17 Apr, 2024, 02:29

Oh, oops, I can just call account,get() on the server when auth'd with JWT?

Nove [876 Gaming]
17 Apr, 2024, 02:32

account.get() will return some user data yes, and when auth'd createJWT will drop a token for you(valid for 15 minutes)

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