Back

How to validate JWT tokens?

  • 0
  • Flutter
  • Web
  • Accounts
Chandan Gowda
12 Jul, 2023, 14:36

My flutter app makes API requests to my NodeJS backend. Now I dont want everyone with the url to make requests to the endpoint. So, i'm creating a JWT token for the signed in user on the app and then sending it in the header. Need help about how to verify it on the server side. Thanks

TL;DR
To validate JWT tokens on the server side, you need to follow these steps: 1. Create a new client in Appwrite and set the Appwrite endpoint, project ID, and the JWT token. 2. With the JWT token, the client on the server can act like a user and perform actions based on the user's permissions. If you need more specific help, check out the documentation here: [link to authentication server documentation](https://appwrite.io/docs/authentication-server)
joeyouss
12 Jul, 2023, 15:13
Chandan Gowda
13 Jul, 2023, 09:12

I went through the documentation but didn't actually get it. Need help.

otik
13 Jul, 2023, 16:30

You have to create a new Client from appwrite and then set appwrite endpoint, appwrite projekt id and that JWT. With JWT then the Client on the server will act like a user (server will be able to do things that the user can do according to permissins)

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