Email/Password
login. You can add a
custom domain to Authorized domains
below according to where you want to
deploy your app. By default localhost is added to the list.
USER
: email
claim under the Namespace
https://dgraph.io/jwt/claims
.
npm install -g firebase-tools
.firebase login
.firebase init functions
then select an existing project (that you
created above).JavaScript
for this example.index.js
with the snippet above.Dgraph Cloud
endpoint in the
config.json.
It looks like this:
JWKURL
, where the JSON Web
Key sets are hosted by Firebase. Since Firebase shares the JWKs among multiple
tenants, you must provide your Firebase project-Id
to the Audience
field. So
the Dgraph.Authorization
header will look like this:
VerificationKey
and Algo
in the Authorization
header. Doing so will cause an error.
Update the
schema,
add the Authorization header (update the project-Id) -
config
) settings, see
base.js.
state
change,
currentUser
will be set to the new user
and context will return App
with
the new idToken
. App
will initialize the Apollo Client which will send this
idToken
in header along with every GraphQL request.