# Struggling to add custom scope to jwt

**URL:** <https://community.auth0.com/t/struggling-to-add-custom-scope-to-jwt/14082>\
**Category:** Get Help\
**Tags:** jwt, auth0\
**Created:** [August 8, 2018, 11:53am UTC](https://community.auth0.com/t/struggling-to-add-custom-scope-to-jwt/14082 "2018-08-08T11:53:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CliveCleaves](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/clivecleaves/32/8336_2.png) [@CliveCleaves](https://community.auth0.com/u/CliveCleaves)\
**Post date:** [August 8, 2018, 11:53am UTC](https://community.auth0.com/t/struggling-to-add-custom-scope-to-jwt/14082/1 "2018-08-08T11:53:00Z")

</div>

As title, I’m struggling to get a custom scope into my JWT for use with an API.

I have the given params when using webAuth:

```auto
  domain: AUTH_CONFIG.domain,
  clientID: AUTH_CONFIG.clientId,
  redirectUri: AUTH_CONFIG.callbackUrl,
  audience: process.env.REACT_APP_CUSTOMER_AUDIENCE,
  responseType: 'token id_token',
  scope: 'openid profile',

```

I am trying to authenticate, and get an accessToken with an additional scope:

```auto
scope: 'openid profile read:cases',

```

But the scope is getting removed from the token during the auth process. I kept seeing this occur so I tried to just specify the individual scope I wanted:

```auto
scope: 'read:cases',

```

And then, upon decoding my token I see:

```auto
aud: "(Customer audience)"
azp: "wFhU2Khd08564TtijiGraCT4fCxhPfiT"
exp: 1533736118
(Custom Claim): "(Claim value)"
iat: 1533728918
iss: "https://(our domain).auth0.com/"
scope: ""
sub: "auth0|(auth0Sub)"

```

Why is my custom scope getting removed from my token?

---

<div class="post-metadata">

**Author:** ![thaddaeus](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@thaddaeus](https://community.auth0.com/u/thaddaeus)\
**Post date:** [August 8, 2018, 10:16pm UTC](https://community.auth0.com/t/struggling-to-add-custom-scope-to-jwt/14082/2 "2018-08-08T22:16:39Z")

</div>

This is because they changed to OIDC specs. I don’t remember seeing this announcement and so not sure when it happened but you now have to build out a custom function to add in namespaced data that doesn’t conform to the OIDC spec…

> **[OpenID Connect Scopes](https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes)**
>
> Understand scopes and claims used with the OpenID Connect (OIDC) protocol.

Essentially custom attributes are not passed automatically anymore, in fact without adding [http://some.domain/](http://some.domain/) as the namespace, it won’t be passed at all. Not really a fan but whatever i guess…

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 26, 2019, 9:03am UTC](https://community.auth0.com/t/struggling-to-add-custom-scope-to-jwt/14082/3 "2019-07-26T09:03:22Z")

</div>


