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/securetoken@system.gserviceaccount.com","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/securetoken@system.gserviceaccount.com

How can I get around this?

Charklewis
  • 4,427
  • 4
  • 31
  • 69

0 Answers0