# Setting jti in tokens with Auth0 Management API v2

**URL:** <https://community.auth0.com/t/setting-jti-in-tokens-with-auth0-management-api-v2/7624>\
**Category:** Get Help\
**Tags:** tokens, jti, v2, management-api\
**Created:** [July 23, 2017, 3:29pm UTC](https://community.auth0.com/t/setting-jti-in-tokens-with-auth0-management-api-v2/7624 "2017-07-23T15:29:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric.barault](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eric.barault/32/7758_2.png) [@eric.barault](https://community.auth0.com/u/eric.barault)\
**Post date:** [July 23, 2017, 3:29pm UTC](https://community.auth0.com/t/setting-jti-in-tokens-with-auth0-management-api-v2/7624/1 "2017-07-23T15:29:37Z")

</div>

After many tries, i wonder if the following documentation on setting the jti claim in jwt tokens is still valid: [blacklists](https://auth0.com/docs/api-auth/blacklists-vs-grants#blacklists)

I defined a rule according to the example:

```
function (user, context, callback) {
  user.jti = require('uuid').v4();
  callback(null, user, context);
}

```

then i’m generating a token with the authorize endpoint as follows:

```
https://mydomain.auth0.com/authorize
    ?audience=https://mydomain.auth0.com/api/v2/
    &scope=openid%20jti&response_type=token
    &client_id=KY4QozMN4ad0...wgoKYUYE
    &redirect_uri=https://www.example.com
    &state=STATE
    &nonce=NONCE

```

I tried several scopes ( **openid** , **openid profile** , **openid jti** ) and both response\_type **token** and **id\_token** , but i never get the jti claim in the generated tokens.

Could you indicate the correct way to get the jti claim in jwt tokens generated for the management api v2 so i can use the blacklist feature to invalidate long lived tokens?

---

<div class="post-metadata">

**Author:** ![jmusgrave](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jmusgrave](https://community.auth0.com/u/jmusgrave)\
**Post date:** [August 18, 2017, 11:38pm UTC](https://community.auth0.com/t/setting-jti-in-tokens-with-auth0-management-api-v2/7624/2 "2017-08-18T23:38:29Z")

</div>

Did you get this figured out?

---

<div class="post-metadata">

**Author:** ![jmusgrave](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jmusgrave](https://community.auth0.com/u/jmusgrave)\
**Post date:** [August 18, 2017, 11:38pm UTC](https://community.auth0.com/t/setting-jti-in-tokens-with-auth0-management-api-v2/7624/3 "2017-08-18T23:38:29Z")

</div>

Did you get this figured out?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/setting-jti-in-tokens-with-auth0-management-api-v2/7624/4 "2018-03-02T05:55:33Z")

</div>


