# Wordpress plugin Auth0 access\_token payload data is empty while decode jwt

**URL:** <https://community.auth0.com/t/wordpress-plugin-auth0-access-token-payload-data-is-empty-while-decode-jwt/97041>\
**Category:** Get Help\
**Tags:** other, community-topic\
**Created:** [December 23, 2022, 7:23pm UTC](https://community.auth0.com/t/wordpress-plugin-auth0-access-token-payload-data-is-empty-while-decode-jwt/97041 "2022-12-23T19:23:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijayavel.rajasekara](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vijayavel.rajasekara/32/33660_2.png) [@vijayavel.rajasekara](https://community.auth0.com/u/vijayavel.rajasekara)\
**Post date:** [December 23, 2022, 7:23pm UTC](https://community.auth0.com/t/wordpress-plugin-auth0-access-token-payload-data-is-empty-while-decode-jwt/97041/1 "2022-12-23T19:23:45Z")

</div>

![image](https://global.discourse-cdn.com/auth0/original/3X/9/b/9ba625ea220b7a32bc6aab46bbd706fcd6d691ce.png)

Trying to use Auth0 access\_token as Bearer token for external api  
but the jwt aud is not valid

In Angular by silent token receiving the below token  
{  
“iss”: “[https://domain.auth0.com/](https://domain.auth0.com/)”,  
“sub”: “email|6333db8bfc6ca34660c6190e”,  
“aud”: [  
“[https://domain.auth0.com/api/v2/](https://domain.auth0.com/api/v2/)”,  
“[https://domain.auth0.com/userinfo](https://domain.auth0.com/userinfo)”  
],  
“iat”: 1671798414,  
“exp”: 1671884814,  
“azp”: “XXXXXXXXXXXXXXXXXXXXXXXXXXXXX”,  
“scope”: “openid profile email offline\_access”  
}

In worpress from the hook i can able to get id\_token and access token

function marketplace\_hook\_auth0\_user\_login($user\_id, $userinfo, $is\_new, $id\_token, $access\_token, $refresh\_token)  
{

```
update_user_meta($user_id, 'auth0_id_token', $id_token);
// update_user_meta($user_id, 'auth0_access_token', $access_token);

```

}  
add\_action(‘auth0\_user\_login’, ‘marketplace\_hook\_auth0\_user\_login’, 10, 6);

while decoding the access\_token get the above screen shot payload empty.  
so the access\_token is getting jwt error

[body] =\> {“message”:“jwt audience invalid. expected: [https://domain.auth0.com/api/v2/](https://domain.auth0.com/api/v2/)”}  
[response] =\> Array  
(  
[code] =\> 401  
[message] =\> Unauthorized  
)

---

<div class="post-metadata">

**Author:** ![vijayavel.rajasekara](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vijayavel.rajasekara/32/33660_2.png) [@vijayavel.rajasekara](https://community.auth0.com/u/vijayavel.rajasekara)\
**Post date:** [December 27, 2022, 12:31pm UTC](https://community.auth0.com/t/wordpress-plugin-auth0-access-token-payload-data-is-empty-while-decode-jwt/97041/2 "2022-12-27T12:31:47Z")

</div>

Solved by using

```auto
add_action('auth0_authorize_url_params', 'authoParams', $priority = 10, $args = 1);
function authoParams($params)
{
    $opts = WP_Auth0_Options::Instance();
    $params['audience'] = 'https://' . $opts->get('domain') . '/api/v2/';

    return $params;
}

```

---

<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:** [January 10, 2023, 12:32pm UTC](https://community.auth0.com/t/wordpress-plugin-auth0-access-token-payload-data-is-empty-while-decode-jwt/97041/3 "2023-01-10T12:32:23Z")

</div>

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