Realm JWT - "signature is invalid"

I’m struggling to get JWT authentication working in Realm following the documentation. I’ve gone through all of the steps in the guide, but I persistently get “signature is invalid”. With no other information available in the log, I’m not sure how to trouble shoot. I’m using to generate the JWT with the following header and payload:


  "alg": "HS256",
  "typ": "JWT"


   "sub": "1234567890",
   "name": "Caleb",
   "iat": 1624553318,
   "exp": 1648849420,
   "aud": "fx-realm-jclla"

The Verify Signature is set as follows:

  base64UrlEncode(header) + "." +

and the checkbox “secret base64 encoded” is checked.

I generated the secret using and chose the SHA 256-bit Key (previously tried the WEP 256-bit key with identical results).

I then enabled custom JWT authentication in the realm and deployed.

I’m testing using Postman. The CURL version of the request looks like this:

curl --location --request GET '' \

--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsI...' \

--header 'Content-Type: application/json' \

--data-raw '{"query":"query {\r\n  salesOrder {\r\n    _id\r\n\t\torderLine {\r\n\t\t  id\r\n\t\t}\r\n\t\torderNumber\r\n  }\r\n}","variables":{}}'

The issue I was having was related to the call being made with “secret base64 encoded” turned on. It apparently must be false. The docs indicate that this box should be checked, but it doesn’t work with this box checked.

Set up JWT Authentication with MongoDB Realm — MongoDB Realm