# Unable to access api endpoints with access token from mobile app

**URL:** <https://community.auth0.com/t/unable-to-access-api-endpoints-with-access-token-from-mobile-app/182438>\
**Category:** Get Help\
**Tags:** clients, management-api\
**Created:** [February 19, 2025, 3:51pm UTC](https://community.auth0.com/t/unable-to-access-api-endpoints-with-access-token-from-mobile-app/182438 "2025-02-19T15:51:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mijo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mijo/32/72993_2.png) [@mijo](https://community.auth0.com/u/mijo)\
**Post date:** [February 19, 2025, 3:51pm UTC](https://community.auth0.com/t/unable-to-access-api-endpoints-with-access-token-from-mobile-app/182438/1 "2025-02-19T15:51:43Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
Hello,  
in my spring boot application (web-api), I get the following error when clients such as postman send requests to the web-api: Failed to authenticate since the JWT was invalid.

We have the following scenario:

We have two native mobile apps (iOS and Android) and one web api (Spring boot).  
The web api is secured by auth0 and clients must first get an access token to interact with the api. Later the api must provide endpoints for creating a user, therefore we need access to the management api from our web api (machine to machine).

Therefore, I walk through the architecture scenarios (get-started/architecture-scenarios/mobile-api), but currently we are unable to get a valid jwt token. In postman I used the auth0 configuration (client id, client secret, auth endpoint, token endpoint, grant type auth code with pcke) from my ios mobile app to get an access token. We get an access token, but when I copy it to jwt io it says “invalid token”.

What are we doing wrong?

---

<div class="post-metadata">

**Author:** ![mijo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mijo/32/72993_2.png) [@mijo](https://community.auth0.com/u/mijo)\
**Post date:** [February 19, 2025, 3:57pm UTC](https://community.auth0.com/t/unable-to-access-api-endpoints-with-access-token-from-mobile-app/182438/2 "2025-02-19T15:57:11Z")

</div>

The response jwt token has the format

```auto
eyXYZ..XYZ

```

A jwt token has three parts: header.payload.signature.

The payload part is obviously empty.

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [February 19, 2025, 4:50pm UTC](https://community.auth0.com/t/unable-to-access-api-endpoints-with-access-token-from-mobile-app/182438/4 "2025-02-19T16:50:28Z")

</div>

Hi @mijo,

Welcome to the Auth0 Community and thank you for your post.

Since you are getting an Access Token, but it’s missing the payload this means that you are receiving an opaque token. Please make sure that you are passing the correct **audience** when making the request to the `/authorize` endpoint, as mentioned in our [Get Access Token](https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens) documentation.

You can refer to this [community post](https://community.auth0.com/t/why-is-my-access-token-an-invalid-format/124557/8) or this [Knowledge Artricle](https://community.auth0.com/t/why-access-token-is-not-a-jwt-opaque-token/31028) as well.

I hope this helped.  
Best regards,  
Remus

---

<div class="post-metadata">

**Author:** ![mijo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mijo/32/72993_2.png) [@mijo](https://community.auth0.com/u/mijo)\
**Post date:** [February 20, 2025, 8:56am UTC](https://community.auth0.com/t/unable-to-access-api-endpoints-with-access-token-from-mobile-app/182438/5 "2025-02-20T08:56:55Z")

</div>

Thank you very much!!

---

<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 6, 2025, 8:57am UTC](https://community.auth0.com/t/unable-to-access-api-endpoints-with-access-token-from-mobile-app/182438/6 "2025-03-06T08:57:37Z")

</div>

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