# Namespace missing in access token

**URL:** <https://forum.canton.network/t/namespace-missing-in-access-token/3606>\
**Category:** App Development\
**Created:** [December 20, 2021, 11:22am UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606 "2021-12-20T11:22:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![priyanka](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@priyanka](https://forum.canton.network/u/priyanka)\
**Post date:** [December 20, 2021, 11:22am UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606/1 "2021-12-20T11:22:02Z")

</div>

Hi Team,

We are upgrading daml version from 1.6.0 to 1.18.0.  
And we unable to get the party details via v1/parties API, we getting below error -

errors: [“namespace missing in access token”]  
status: 401

Can you help us on this issue.

Regards,  
Priyanka

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [December 20, 2021, 11:28am UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606/2 "2021-12-20T11:28:06Z")

</div>

Hi @priyanka and welcome to the forum 😃

Are you making the request via the HTTP JSON API?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [December 20, 2021, 11:30am UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606/3 "2021-12-20T11:30:04Z")

</div>

Can you share your decoded JWT token? It sounds like it has an invalid format.

---

<div class="post-metadata">

**Author:** ![priyanka](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@priyanka](https://forum.canton.network/u/priyanka)\
**Post date:** [December 20, 2021, 12:51pm UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606/4 "2021-12-20T12:51:06Z")

</div>

Hi,

Please find token detail below

> **Token**
>
> HEADER:ALGORITHM & TOKEN TYPE
> 
> {  
> “alg”: “RS256”,  
> “typ”: “JWT”,  
> “kid”: “blbuM\_wwxxxxxmoRHgT52urXCnrRjo2upMfn9-W93DeU”  
> }
> 
> PAYLOAD:DATA
> 
> {  
> “exp”: 1788884832,  
> “iat”: 1688883951,  
> “auth\_time”: 1639987633,  
> “jti”: “48wed2e6-84af-41ae-b5dd-976d29c3f999”,  
> “iss”: “[https://xxx.xxx.xx](https://xxx.xxx.xx)”,  
> “aud”: “account”,  
> “sub”: “1f2971de-63e7-43fa-b791d-cb60ea920xxx”,  
> “typ”: “Bearer”,  
> “azp”: “xxx”,  
> “nonce”: “d5css71f-b0b8-4bfd-bhja-da67709027ec”,  
> “session\_state”: “xxxefd-eb0f-4320-b79d-335xxx75”,  
> “acr”: “0”,  
> “allowed-origins”: [  
> “[http://xxxx](http://xxxx)”,  
> “[https://xxxxx](https://xxxxx)”  
> ],  
> “realm\_access”: {  
> “roles”: [  
> “offline\_access”  
> ]  
> },  
> “resource\_access”: {  
> “xxxxx-ui”: {  
> “roles”: [  
> “xxxxx-admin”  
> ]  
> },  
> “account”: {  
> “roles”: [  
> “xxxxx-account”,  
> “xxxxx-account-links”,  
> “xxxxx-profile”  
> ]  
> }  
> },  
> “scope”: “openid email profile”,  
> “ledgerId”: “xxxxxxxxxx”,  
> “actAs”: [  
> “Operator”  
> ],  
> “email\_verified”: true,  
> “name”: “xxxxxxxxx”,  
> “admin”: true,  
> “preferred\_username”: “xxxxxxx”,  
> “given\_name”: “xxxxx”,  
> “applicationId”: “xxxxxxxx”,  
> “family\_name”: “xxxxxxx”,  
> “email”: “xxxxxxxxxxxx”,  
> “party”: “Operator”  
> }  
> This text will be hidden

please let me know if you need more information.

---

<div class="post-metadata">

**Author:** ![priyanka](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@priyanka](https://forum.canton.network/u/priyanka)\
**Post date:** [December 20, 2021, 12:54pm UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606/5 "2021-12-20T12:54:23Z")

</div>

> [@priyanka](#):
>
> v1/parties

I am making request to v1/parties with below header

headers: {

```
  "Content-Type": "application/json"

}

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [December 20, 2021, 3:57pm UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606/6 "2021-12-20T15:57:55Z")

</div>

Hi @priyanka , unfortunately it looks like there has been a regression with regards to the legacy token format you’re using in the JSON API in SDK 1.17 and newer. I’ve opened [[BUG] JSON API rejects tokens without oidc namespace · Issue #12215 · digital-asset/daml · GitHub](https://github.com/digital-asset/daml/issues/12215) to track this.

In the meantime, you have two options:

1. Upgrade only to 1.16 which still supports that token format without errors.
2. Switch to the new token format where the values are nested below the oidc namespace, e.g.,  
replace

```haskell
{
  "ledgerId": "xxxxxxxxxx",
  "actAs": [
    "Operator"
  ],
  "admin": true,
  "applicationId": "xxxxxxxx"
}

```

by

```haskell
{
  "https://daml.com/ledger-api": {
    "ledgerId": "xxxxxxxxxx",
    "actAs": [
      "Operator"
    ],
    "admin": true,
    "applicationId": "xxxxxxxx"
  }
}

```

Note that the format you are using has been deprecated since SDK 1.0 so you should make the switch eventually either way.

---

<div class="post-metadata">

**Author:** ![priyanka](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@priyanka](https://forum.canton.network/u/priyanka)\
**Post date:** [December 22, 2021, 11:24am UTC](https://forum.canton.network/t/namespace-missing-in-access-token/3606/7 "2021-12-22T11:24:42Z")

</div>

okay, Thank you for your help.  
Yes with 1.16.0 it accepts token.
