# Authorized Party (azp) claim mismatch in the ID token

**URL:** <https://community.auth0.com/t/authorized-party-azp-claim-mismatch-in-the-id-token/37323>\
**Category:** Get Help\
**Created:** [February 3, 2020, 8:49pm UTC](https://community.auth0.com/t/authorized-party-azp-claim-mismatch-in-the-id-token/37323 "2020-02-03T20:49:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan5](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ryan5/32/18891_2.png) [@ryan5](https://community.auth0.com/u/ryan5)\
**Post date:** [February 3, 2020, 8:49pm UTC](https://community.auth0.com/t/authorized-party-azp-claim-mismatch-in-the-id-token/37323/1 "2020-02-03T20:49:04Z")

</div>

I’m getting “Authorized Party (azp) claim mismatch in the ID token”.

Looking in the SDK’s, it seems to be because the mobile app token seems to be returning two 'aud’s, the API Audience, and the ‘{domain}//userinfo’ endpoint.

AUTH0\_AUDIENCE = My application Client ID.

**Mobile App Code**

```auto
    Auth0
                .webAuth()
                .scope("openid")
                .audience("AUTH0_AUDIENCE")
                .start {
                    switch $0 {
                    case .failure(let error):
                        // Handle the error
                        print("Error: \(error)")
                    case .success(let credentials):
                        print(credentials.accessToken))
                    }
            }

```

**PHP API**

```
$token_issuer = 'https://'.env('AUTH0_DOMAIN').'/';
            $jwks_fetcher = new JWKFetcher();
            $jwks = $jwks_fetcher->getKeys($token_issuer.'.well-known/jwks.json');
            $signature_verifier = new AsymmetricVerifier($jwks);
    
            $token_verifier = new IdTokenVerifier(
              $token_issuer,
              env('AUTH0_AUDIENCE'),
              $signature_verifier
            );
    
            try {
              $decoded_token = $token_verifier->verify($accessToken);
            } catch (\Exception $e) {
              return null;
            }

```

```auto

```

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [February 10, 2020, 9:51pm UTC](https://community.auth0.com/t/authorized-party-azp-claim-mismatch-in-the-id-token/37323/2 "2020-02-10T21:51:36Z")

</div>

Hi there @ryan5 and welcome to the Auth0 Community!

Are you sure in your mobile app code it’s picking up the AUTH0\_AUDIENCE as it does in your .env file? Is there any additional details you can share with us on this front? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ryan5](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ryan5/32/18891_2.png) [@ryan5](https://community.auth0.com/u/ryan5)\
**Post date:** [February 11, 2020, 9:15am UTC](https://community.auth0.com/t/authorized-party-azp-claim-mismatch-in-the-id-token/37323/4 "2020-02-11T09:15:14Z")

</div>

Thanks!!

For anyone coming across the same issue, I’ve managed to debug with the help of @joshcanhelp - [Authorized Party (azp) claim mismatch in the ID token · Issue #422 · auth0/auth0-PHP · GitHub](https://github.com/auth0/auth0-PHP/issues/422)

---

<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:** [March 5, 2020, 9:18pm UTC](https://community.auth0.com/t/authorized-party-azp-claim-mismatch-in-the-id-token/37323/5 "2020-03-05T21:18:19Z")

</div>

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