Hi
I have read the post here which shows the same error I am seeing. I am trying to send the example query (client.query(q.Abs(1))
) that should not require any permissions as per suggestion in the other post.
I have tested the client configuration with a normal key associated to the same role as the auth0 provider has been given and it connects fine and returns expected { result: 1 }
.
I have also tested by configuring the API in auth0 with the identity
value given to auth0 as the region URL (in my case https://db.eu.fauna.com/db/my_id
) with same error.
The auth0 token I am using is being fetched from the /auth0/token
endpoint with the aud
as https://db.fauna.com/db/my_id
(no region specified) .
Fauna provider seems correctly configured with the issuer value matching that in the auth0
token and the wellknown endpoint returning the right keys.
Any ideas where I am going wrong?
Unauthorized {
name: 'Unauthorized',
message: 'unauthorized. Check that endpoint, schema, port and secret are correct during client’s instantiation',
description: 'Unauthorized',
requestResult: RequestResult {
method: 'POST',
path: '',
query: null,
requestRaw: '{"abs":1}',
requestContent: Expr { raw: [Object] },
responseRaw: '{"errors":[{"code":"unauthorized","description":"Unauthorized"}]}',
responseContent: { errors: [Array] },
statusCode: 401,
responseHeaders: [Object: null prototype] {
':status': 401,
'www-authenticate': 'Basic realm="Unauthorized"',
'x-txn-time': '1665241505440097',
'x-faunadb-build': '220928.015029-7c1f8c3',
traceparent: '00-c334b7f9acd7db78abfadafc2b99da9d-52808a5012495e2c-00',
'content-length': '65',
'content-type': 'application/json;charset=utf-8',
[Symbol(nodejs.http2.sensitiveHeaders)]: []
},
startTime: 1665241505408,
endTime: 1665241505516
}
}
\\\