Need help. I am trying to create JWT token on rest api (Client) with post request but I am getting this response {"message":"User(role:guests) missing scope (account)","code":401,"type":"general_unauthorized_scope"......... . I have created email session but still getting this response.
"User(role:guests) missing scope" when creating JWT
role:guests indicates you don't have a valid session. You need to log in first
Noted, but Sir I have created an email session using rest API and after I got user credentials then I posted a JWT request.
Sure, but the session you created wasn't used when making the create JWT API call
Can you tell me more about your tech stack?
Docker
I meant for your front end app
Sir, I am making call from Android using client rest API. Wanted to use Android sdks but they are in aar instead of Jar, and App inventor only allow Jar files. So, using rest API.
I see. So you may have to manually manage the session by making sure the cookie is used in the subsequent requests. See https://appwrite.io/docs/rest#client-auth
Is there a way, I pass user id or session I'd from user credentials in rest request for JWT to make JWT request.
I am able to create user successfully and then able to log them in using rest. Also able to get all documents with rules(any) but when I try to change rules to only logged in, not getting any data despite I have logged in user in previous request. So thought that my might pass user JWT to get data. That's the reason of creating a JWT for me.
Did you read what I linked?
Sir, I created session the response I am getting is below (example response) but their is no cookie in response. { "$id": "5e5ea5c16897e", "$createdAt": "2020-10-15T06:38:00.000+00:00", "userId": "5e5bb8c16897e", "expire": "2020-10-15T06:38:00.000+00:00", "provider": "email", "providerUid": "user@example.com", "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", "ip": "127.0.0.1", "osCode": "Mac", "osName": "Mac", "osVersion": "Mac", "clientType": "browser", "clientCode": "CM", "clientName": "Chrome Mobile iOS", "clientVersion": "84.0", "clientEngine": "WebKit", "clientEngineVersion": "605.1.15", "deviceName": "smartphone", "deviceBrand": "Google", "deviceModel": "Nexus 5", "countryCode": "US", "countryName": "United States", "current": true }
Cookies are always sent in the header
So, When I create a session using email, I will get body response in above format and I also get cookie in header of response.
Will try, thaks
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...