3

I am trying to find a good way to use the Firebase auth emulator and Dgraph. In Dgraph you send a JWT which contains claims that you can check in Dgraph to allow / limit queries and mutations.

In the Dgraph schema you are required to add the below code:

# Dgraph.Authorization {"Header":"X-Auth-Token","Namespace":"https://dgraph.io/jwt/claims","JWKURL":"https://www.googleapis.com/service_accounts/v1/jwk/[email protected]","Audience":["firebase-project-id"]}

I am finding the JWKURL value is invalid when using the firebase auth emulator. It returns this error.

couldn't rewrite query getUser because unable to parse jwt token:token is unverifiable: Keyfunc returned an error

When I try try to use the localhost url Dgraph fails as it can't connect to it.

For example:

localhost:9099/service_accounts/v1/jwk/[email protected]

How can I get around this?

1
  • Hello, I'm having issues getting DGraph to recognize the token claims. Were you able to get it to work (not in the emulator)? Commented May 4, 2021 at 19:58

1 Answer 1

0

Most probably it is because your JWKSURL value is not correct. I had the same error message and realised I was providing the wrong value for JKWSURL. I'm not exactly sure what it should be for a firebase app but usually they end in .well-known/jwks.json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.