# How to solve The JWT string must have two dots.

**URL:** <https://forum.shopware.com/t/how-to-solve-the-jwt-string-must-have-two-dots/61907>\
**Category:** Shopware Playground - API first Sandbox (EN)\
**Created:** [21. September 2019 um 10:34 UTC](https://forum.shopware.com/t/how-to-solve-the-jwt-string-must-have-two-dots/61907 "2019-09-21T10:34:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaksolanki10](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@ronaksolanki10](https://forum.shopware.com/u/ronaksolanki10)\
**Post date:** [21. September 2019 um 10:34 UTC](https://forum.shopware.com/t/how-to-solve-the-jwt-string-must-have-two-dots/61907/1 "2019-09-21T10:34:22Z")

</div>

```
 When i am trying to get the product list with ../api/v1/product API with passing valid token. i am receiving the below response. { &nbsp;"errors": &nbsp; [&nbsp; { &nbsp; "code":"9", &nbsp; "status":"401", &nbsp; "title":"The resource owner or authorization server denied the request.", &nbsp; "detail":"The JWT string must have two dots" &nbsp; } &nbsp;] }

```

The curl request is like following.

&nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; $curl = curl\_init();  
&nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($curl, CURLOPT\_URL, $url);  
&nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($curl, CURLOPT\_RETURNTRANSFER, true);  
&nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($curl, CURLOPT\_CUSTOMREQUEST, ‘GET’);  
&nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt(  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $curl,  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT\_HTTPHEADER,  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [‘Content-Type: application/json’,  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;‘Authorization: Bearer {$token}’  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]  
&nbsp; &nbsp; &nbsp; &nbsp; );

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [21. September 2019 um 10:42 UTC](https://forum.shopware.com/t/how-to-solve-the-jwt-string-must-have-two-dots/61907/2 "2019-09-21T10:42:25Z")

</div>

So, where is your actual access token? =\>&nbsp;[https://docs.shopware.com/en/shopware-platform-dev-en/api/admin-authentication?category=shopware-platform-dev-en/api#access-token](https://docs.shopware.com/en/shopware-platform-dev-en/api/admin-authentication?category=shopware-platform-dev-en/api#access-token)

And as you can see: your token is of course not valid. Did you passed maybe the refresh token instead of the access token?

Maybe this helps =\>&nbsp;[https://github.com/laravel/passport/issues/60](https://github.com/laravel/passport/issues/60)

Or this =\>&nbsp;[https://www.google.com/search?q=The+JWT+string+must+have+two+dots&oq=The+JWT+string+must+have+two+dots&aqs=chrome…69i57j0l3j69i60.390j0j7&sourceid=chrome&ie=UTF-8](https://www.google.com/search?q=The+JWT+string+must+have+two+dots&oq=The+JWT+string+must+have+two+dots&aqs=chrome..69i57j0l3j69i60.390j0j7&sourceid=chrome&ie=UTF-8)

---

<div class="post-metadata">

**Author:** ![ronaksolanki10](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@ronaksolanki10](https://forum.shopware.com/u/ronaksolanki10)\
**Post date:** [21. September 2019 um 10:56 UTC](https://forum.shopware.com/t/how-to-solve-the-jwt-string-must-have-two-dots/61907/3 "2019-09-21T10:56:27Z")

</div>

> [@Shopwareianer schrieb:](https://forum.shopware.com/profile/15489/Shopwareianer "Shopwareianer")
> 
> So, where is your actual access token? =\>&nbsp;[https://docs.shopware.com/en/shopware-platform-dev-en/api/admin-authentication?category=shopware-platform-dev-en/api#access-token](https://docs.shopware.com/en/shopware-platform-dev-en/api/admin-authentication?category=shopware-platform-dev-en/api#access-token)
> 
> And as you can see: your token is of course not valid. Did you passed the maybe the refresh token instead of the access token?
> 
> Maybe this helps =\>&nbsp;[https://github.com/laravel/passport/issues/60](https://github.com/laravel/passport/issues/60)
> 
> Or this =\>&nbsp;[https://www.google.com/search?q=The+JWT+string+must+have+two+dots&oq=The+JWT+string+must+have+two+dots&aqs=chrome…69i57j0l3j69i60.390j0j7&sourceid=chrome&ie=UTF-8](https://www.google.com/search?q=The+JWT+string+must+have+two+dots&oq=The+JWT+string+must+have+two+dots&aqs=chrome..69i57j0l3j69i60.390j0j7&sourceid=chrome&ie=UTF-8)
> 
> &nbsp;
> 
> **Yes @Shopwareianer, you are right. i was passing the wrong token. now i am able to fetch the product list, thank you so much for your valuable response.**

---

<div class="post-metadata">

**Author:** ![Artsakh](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Artsakh](https://forum.shopware.com/u/Artsakh)\
**Post date:** [27. März 2020 um 11:47 UTC](https://forum.shopware.com/t/how-to-solve-the-jwt-string-must-have-two-dots/61907/4 "2020-03-27T11:47:25Z")

</div>

I have also the same problem.  
I am calling the API with curl like this:

curl -H „Authorization: Bearer TGx4cUwyQjJUbzVMMHZBWjBmUkQ3WUtGenVsSjU1Zk9Gb25IMEY“ -H „Content-Type: application/json“ [https://localhost/api/v1/product](https://localhost/api/v1/product) -k

Whereas the passed Bearer token I got from&nbsp;[http://localhost/admin#/](http://localhost/admin#/)&nbsp;and then Settings-\>System-\>Integrations (Secret access key)
