Enriching user profile visibility via custom claims inside a Vue JS SPA

I spent another hour trying to figure this out and finally got it to work. Here’s how –

In /src/auth/authWrapper.js, for the “this.auth0Client” instantiation of the createAuth0Client() object [line 75 in the sample Vue auth0 login repo], I added to the other enumerated properties, one for scope:

scope: options.idToken,

I added this as the second to last one, the last is still redirect_uri.

In src/views/profile.vue, I wanted to show the data for a custom claim of the user’s physical address, so I added this line for where the data for it came from –

Address: {{ $auth.user[‘https://namespacedURLhere/address’] }}

It felt like there was nothing intuitive about this being the way to “extract” and “decode” the data for a custom claim, and it would really help if this was documented somewhere in all of the great help content that you have on the Auth0 site.

I will copy-paste this post to the issue I opened in the Github repo and close it.

1 Like