# Access forbidden Error

**URL:** <https://community.dreamfactory.com/t/access-forbidden-error/1691>\
**Category:** REST API\
**Created:** [October 31, 2015, 9:07am UTC](https://community.dreamfactory.com/t/access-forbidden-error/1691 "2015-10-31T09:07:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pitw](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@pitw](https://community.dreamfactory.com/u/pitw)\
**Post date:** [October 31, 2015, 9:07am UTC](https://community.dreamfactory.com/t/access-forbidden-error/1691/1 "2015-10-31T09:07:30Z")

</div>

We try to upgrade our app from v1.9 to v2.  
Beside the fact that V2 is much faster (!) we struggling with the following error:

First we login as demo user:

URL (POST):  
…/api/v2/user/session

With body:

{  
“email”: "user@test.com",  
“password”: “password”,  
“duration”: 0  
}

This works and returns a session\_token and a session\_id.

In next step we try to call the service “db” / app “apptest”

URL (GET):  
…/api/v2/db

With header:  
X-DreamFactory-Session-Token --\> session\_token from above  
X-DreamFactory-Application-Name --\> apptest

This returns:

“error”: {  
“context”: null,  
“message”: “Access Forbidden.”,  
“code”: 403,

We have created a role with permissions on all services. Also we enabled CORS with \* and assigned created role to user.

Problem stays the same on local install and on dreamfactory enterprise. We also tested with different services,users and roles.

---

<div class="post-metadata">

**Author:** ![pitw](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@pitw](https://community.dreamfactory.com/u/pitw)\
**Post date:** [October 31, 2015, 1:48pm UTC](https://community.dreamfactory.com/t/access-forbidden-error/1691/2 "2015-10-31T13:48:17Z")

</div>

After some try + error I found out that if using X-DreamFactory-Api-Key instead of X-DreamFactory-Application-Name the request works.

Is X-DreamFactory-Application-Name deprecated in V2?

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [November 3, 2015, 4:00pm UTC](https://community.dreamfactory.com/t/access-forbidden-error/1691/3 "2015-11-03T16:00:59Z")

</div>

> [@pitw](#):
>
> Is X-DreamFactory-Application-Name deprecated in V2?

Yes. As 2.0 is a complete rebuild and not an upgrade, some things like this have changed. I recommend checking [the 2.0 wiki](https://wiki.dreamfactory.com) for details if you encounter this or other issues. The API key aspect is covered on [this documentation page](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Access_Using_API_Key).

---

<div class="post-metadata">

**Author:** ![pitw](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@pitw](https://community.dreamfactory.com/u/pitw)\
**Post date:** [November 3, 2015, 4:11pm UTC](https://community.dreamfactory.com/t/access-forbidden-error/1691/4 "2015-11-03T16:11:43Z")

</div>

Thanks Jeffrey

We already found out 😉
