# How to reference Custom namespaced id token fields

**URL:** <https://community.auth0.com/t/how-to-reference-custom-namespaced-id-token-fields/52032>\
**Category:** Get Help\
**Tags:** jwt, id\_token, auth0\
**Created:** [October 23, 2020, 1:14am UTC](https://community.auth0.com/t/how-to-reference-custom-namespaced-id-token-fields/52032 "2020-10-23T01:14:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolfbrownie1995](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wolfbrownie1995/32/18608_2.png) [@wolfbrownie1995](https://community.auth0.com/u/wolfbrownie1995)\
**Post date:** [October 23, 2020, 1:14am UTC](https://community.auth0.com/t/how-to-reference-custom-namespaced-id-token-fields/52032/1 "2020-10-23T01:14:33Z")

</div>

I have created some custom ID tokens to the auth0 standard of using a namespace such as ‘[http://www.test.com/roles](http://www.test.com/roles)’ and assigned an array of roles (strings) to the said idtoken.

Problem is I am now in vuejs/javascript, I have received my id token but how do I reference a variable with the name ‘[http://www.test.com/roles](http://www.test.com/roles)’ as the second I reference user.[http://www.test.com/roles](http://www.test.com/roles) I get an error because of the ‘:’ colon in the variable name and the 2 slashes are being treated as comments.

this.$parent.$parent.user.[http://www.stutor.com/roles](http://www.stutor.com/roles) is erroring out due to the colon and the slashes in the variable name.

Please help!!!  
Thanks

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [October 23, 2020, 1:09pm UTC](https://community.auth0.com/t/how-to-reference-custom-namespaced-id-token-fields/52032/2 "2020-10-23T13:09:31Z")

</div>

Hi @wolfbrownie1995,

You’ll need to use the bracket notation instead of dot notation when the key is a URL like that

e.g.  
`user["http://www.stutor.com/roles"]`

Some more example are here: [JSON Literals](https://www.w3schools.com/js/js_json_objects.asp)

---

<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:** [November 7, 2020, 1:09pm UTC](https://community.auth0.com/t/how-to-reference-custom-namespaced-id-token-fields/52032/3 "2020-11-07T13:09:34Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
