# Authorization not working in Ionic2

**URL:** <https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880>\
**Category:** ionic-v3\
**Created:** [May 26, 2017, 2:04pm UTC](https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880 "2017-05-26T14:04:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathantaal](https://avatars.discourse-cdn.com/v4/letter/n/f04885/32.png) [@nathantaal](https://forum.ionicframework.com/u/nathantaal)\
**Post date:** [May 26, 2017, 2:04pm UTC](https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880/1 "2017-05-26T14:04:19Z")

</div>

Hello everyone,  
I’m trying to authenticate in ionic3. It works fine in postman.

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/2/0/2071106b93d8d67dbfc3bd5771fde010febd3230.PNG)

In Ionic i get an 403, no token provided This is the code.

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/b/a/bafaa2ddc3efd512ff920152c1c6b4070d96efe2.PNG)

I think I’m doing something wrong with headers, i Just don’t know what.  
Ps. my nodejs backend is based on this tutorial:

> **[Authenticate a Node ES6 API with JSON Web Tokens](https://scotch.io/tutorials/authenticate-a-node-es6-api-with-json-web-tokens)**
>
> Learn how to effectively use JSON web tokens to authenticate in nodeJS APIs

Who can help me?

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 26, 2017, 3:07pm UTC](https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880/2 "2017-05-26T15:07:28Z")

</div>

Did you remote debug the problem on the device already?  
Follow these instructions here to debug the problem in Safari dev tools:  
[https://ionic.zone/debug/remote-debug-your-app#ios](https://ionic.zone/debug/remote-debug-your-app#ios)  
Follow these instructions here to debug the problem in Chrome dev tools:  
[https://ionic.zone/debug/remote-debug-your-app#android](https://ionic.zone/debug/remote-debug-your-app#android)  
Look at the console and network tabs for errors.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 26, 2017, 3:08pm UTC](https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880/3 "2017-05-26T15:08:29Z")

</div>

In your code you define a header “Authorization” with value “x-access-tokeneyJHbGc…”. Compare that to Postman.

---

<div class="post-metadata">

**Author:** ![nathantaal](https://avatars.discourse-cdn.com/v4/letter/n/f04885/32.png) [@nathantaal](https://forum.ionicframework.com/u/nathantaal)\
**Post date:** [May 26, 2017, 3:21pm UTC](https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880/4 "2017-05-26T15:21:05Z")

</div>

Wel if you mean I have to add an space (stupid me) I offcourse did that already but that doesn’t work. Still thinking there’s something else wrong with the headers

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 26, 2017, 3:35pm UTC](https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880/5 "2017-05-26T15:35:05Z")

</div>

No, I mean that the header is called “Authorization” right now but should be called “x-access-token” and have only the JWT token as a key, not more.

---

<div class="post-metadata">

**Author:** ![nathantaal](https://avatars.discourse-cdn.com/v4/letter/n/f04885/32.png) [@nathantaal](https://forum.ionicframework.com/u/nathantaal)\
**Post date:** [May 26, 2017, 3:37pm UTC](https://forum.ionicframework.com/t/authorization-not-working-in-ionic2/91880/6 "2017-05-26T15:37:49Z")

</div>

You’re right.  
Thank you very much
