# Using JWT claim data outside of an auth rule?

**URL:** <https://discuss.dgraph.io/t/using-jwt-claim-data-outside-of-an-auth-rule/14428>\
**Category:** GraphQL\
**Tags:** kind:question\
**Created:** [June 4, 2021, 4:54am UTC](https://discuss.dgraph.io/t/using-jwt-claim-data-outside-of-an-auth-rule/14428 "2021-06-04T04:54:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacejunky](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/spacejunky/32/8252_2.png) [@spacejunky](https://discuss.dgraph.io/u/spacejunky)\
**Post date:** [June 4, 2021, 4:54am UTC](https://discuss.dgraph.io/t/using-jwt-claim-data-outside-of-an-auth-rule/14428/1 "2021-06-04T04:54:08Z")

</div>

Is it possible to use JWT claim data outside of an auth rule? I would like, for example, to be able to use things like an email, which is contained in the JWT, with an addXyzzy or updateXyzzy mutation.

Although they appear to be created as variables for the purposes of the auth rule it seems like the values are only available in that scope and not elsewhere?

Or am I missing something obvious?

[Edit] For example, are they available somewhere in the context of a lambda mutation?

---

<div class="post-metadata">

**Author:** ![Thammada](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/thammada/32/8360_2.png) [@Thammada](https://discuss.dgraph.io/u/Thammada)\
**Post date:** [June 4, 2021, 9:33am UTC](https://discuss.dgraph.io/t/using-jwt-claim-data-outside-of-an-auth-rule/14428/2 "2021-06-04T09:33:27Z")

</div>

Yes, they are available. Although not yet documented, you can check out this excellent answer from my similar question.

> [@Auth variables access on custom resolver](http://discuss.hypermode.com/t/auth-variables-access-on-custom-resolver/13893/2):
>
> In a custom lambda, you can access the authHeader directly, although I think they eventually plan to support @auth fields: And you can repass the header to another graphql request like so: J

You can see this by peeking at the type definitions for lambda resolvers

> <https://github.com/dgraph-io/dgraph-lambda/blob/13919e45f10a4ba43dc7451226442cf63db350fe/slash-graphql-lambda-types/types.d.ts#L83>

---

<div class="post-metadata">

**Author:** ![spacejunky](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/spacejunky/32/8252_2.png) [@spacejunky](https://discuss.dgraph.io/u/spacejunky)\
**Post date:** [June 4, 2021, 11:04am UTC](https://discuss.dgraph.io/t/using-jwt-claim-data-outside-of-an-auth-rule/14428/3 "2021-06-04T11:04:44Z")

</div>

Many thanks
