Back

[SOLVED] Postman Client: "User (role: guests) missing scope (account) error

  • 1
  • Self Hosted
  • Accounts
  • Web
ashuvssut (ashu)
30 May, 2023, 22:03

Ops

TL;DR
The user is experiencing an error with the Postman client related to missing scope for user role guests. The issue may be caused by making requests from an HTTP web app instead of HTTPS. The user confirms that making requests from HTTP is causing the issue. The user also discovers that JWT authentication is disabled for the project. Creating a JWT returns a 501 error with the message "JWT authentication is disabled for this project." The user also shares the request headers and response for the create JWT and get account APIs. There is no solution provided in the thread.
ashuvssut (ashu)
30 May, 2023, 22:03

I ll comeback to you. I haven't tested "get user details"

ashuvssut (ashu)
30 May, 2023, 22:03

Api

ashuvssut (ashu)
30 May, 2023, 22:09

Oh i just remembered that I did not try that because in rest api docs, the get account api asks for x-appwrite-jwt

ashuvssut (ashu)
30 May, 2023, 22:09

So before making "get account" request, i need createJwt request to get a jwt

Drake
30 May, 2023, 22:10

Nah, you can use the cookie

ashuvssut (ashu)
30 May, 2023, 22:10

Okay doin it right now

ashuvssut (ashu)
30 May, 2023, 22:13

Works correctly for get account api

ashuvssut (ashu)
30 May, 2023, 22:13

Plz wait i m pasting the headers

ashuvssut (ashu)
30 May, 2023, 22:16

Request Headers

TypeScript
Accept: application/json
X-Appwrite-Project: 6469040898e19fe9052c
User-Agent: PostmanRuntime/7.32.2
Postman-Token: 195cc7fa-fe7f-4687-b61b-cd734b3a02bd
Host: cloud.appwrite.io
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: a_session_6469040898e19fe9052c=<cookie stored in postman from prev request of create session with email>; a_session_6469040898e19fe9052c_legacy=<same cookie goes here too>

Response Headers

TypeScript
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-Appwrite-ID, Content-Range, Range, Cache-Control, Expires, Pragma
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE
Access-Control-Allow-Origin: https://localhost
Access-Control-Expose-Headers: X-Fallback-Cookies
Content-Encoding: br
Content-Length: 188
Content-Type: application/json; charset=UTF-8
Date: Tue, 30 May 2023 22:13:01 GMT
Server: Appwrite
Strict-Transport-Security: max-age=10886400
X-Content-Type-Options: nosniff
X-Debug-Fallback: false
X-Debug-Speed: 0.0067610740661621

Response Body

TypeScript
{"$id":"91a35da6-13ef-4355-8c18-d86c743044d9","$createdAt":"2023-05-30T22:10:56.007+00:00","$updatedAt":"2023-05-30T22:10:56.007+00:00","name":"Rhoda","registration":"2023-05-30T22:10:56.006+00:00","status":true,"passwordUpdate":"2023-05-30T22:10:56.006+00:00","email":"leif_herman95@hotmail.com","phone":"","emailVerification":false,"phoneVerification":false,"prefs":{}}
Drake
30 May, 2023, 22:18

Anything look different to you between the request headers of the get account vs create JWT?

ashuvssut (ashu)
30 May, 2023, 22:19

oh no

now createJwt shows 501. wait i ll paste its response too

ashuvssut (ashu)
30 May, 2023, 22:20

POST https://cloud.appwrite.io/v1/account/jwt 501 1421 ms

Request Headers

TypeScript
Accept: application/json
X-Appwrite-Project: 6469040898e19fe9052c
User-Agent: PostmanRuntime/7.32.2
Postman-Token: 73b96943-6b66-4583-9cee-28d325a0fc7e
Host: cloud.appwrite.io
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: <session cookie goes here>;a_session_6469040898e19fe9052c_legacy=<session cookie goes here>
Content-Length: 0

Response Headers

TypeScript
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-Appwrite-ID, Content-Range, Range, Cache-Control, Expires, Pragma
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE
Access-Control-Allow-Origin: https://localhost
Access-Control-Expose-Headers: X-Fallback-Cookies
Cache-Control: no-cache, no-store, must-revalidate
Content-Encoding: br
Content-Length: 96
Content-Type: application/json; charset=UTF-8
Date: Tue, 30 May 2023 22:17:46 GMT
Expires: 0
Pragma: no-cache
Server: Appwrite
Strict-Transport-Security: max-age=10886400
X-Content-Type-Options: nosniff
X-Debug-Fallback: false
X-Debug-Speed: 0.4664580821991
X-Ratelimit-Limit: 100
X-Ratelimit-Remaining: 99
X-Ratelimit-Reset: 1685487600

Response Body

TypeScript
{"message":"JWT authentication is disabled for this project","code":501,"type":"user_auth_method_unsupported","version":"0.10.22"}
ashuvssut (ashu)
30 May, 2023, 22:21

ah i get it now from this request

ashuvssut (ashu)
30 May, 2023, 22:22

i gonna go enable JWT auth first in the console

ashuvssut (ashu)
30 May, 2023, 22:22

really sorry

Drake
30 May, 2023, 22:22

No worries!

ashuvssut (ashu)
30 May, 2023, 22:23

got the JWT

ashuvssut (ashu)
30 May, 2023, 22:23

thanks!

ashuvssut (ashu)
30 May, 2023, 22:24

[SOLVED] Postman Client: "User (role: guests) missing scope (account) error

ashuvssut (ashu)
30 May, 2023, 22:27

Steven, I can see Access-Control-Allow-Origin: https://localhost header in response

is it possible to make such requests from a webapp which is at http://localhost?

Note its on http not https

ashuvssut (ashu)
30 May, 2023, 22:28

.

Drake
30 May, 2023, 22:32

Yep should be fine

ashuvssut (ashu)
30 May, 2023, 22:39

Actually I was working on react-native-web

that webapp is hosted on http://locahost:19000

when getting a response from createSessionWithEmail request (REST API), I get the same set-cookie headers in response header, the cookies are not set in cookie storage in web app.

Thats why I guess that by making requests from http:// might be causing this issue (since its the only difference in headers when making the request from postman vs making the same request from webapp)

ashuvssut (ashu)
30 May, 2023, 22:58

It might be issue in react-native-web I am not sure.

i am gonna go confirm this first by creating a normal react app hosted on http://

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