# APPLICATION\_URL variable after change of Admin backend URL

**URL:** <https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487>\
**Category:** Help me!\
**Created:** [May 12, 2021, 4:12pm UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487 "2021-05-12T16:12:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Kynnersley](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/ian_kynnersley/32/1218_2.png) [@Ian\_Kynnersley](https://community.forestadmin.com/u/Ian_Kynnersley)\
**Post date:** [May 12, 2021, 4:12pm UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487/1 "2021-05-12T16:12:15Z")

</div>

We have changed the backend URL for our production environment. We have changed the “Admin backend URL” value in the Settings area of the site according to reflect the new URL and the site works as expected.

I noticed that the deployed backend still had the old URL in the APPLICATION\_URL environment variable so I amended it to the new URL and re-deployed the backend.

## Expected behavior

The correct URL stored in the APPLICATION\_URL environment variable on the backend server would enable the user to authenticate and use the site.

## Actual behavior

All users see a “Cannot authenticate you” message repeatedly despite entering correct credentials. This message is consistent with an incorrectly set APPLICATION\_URL.

Reverting the APPLICATION\_URL environment variable back to the _old_ URL allows users to authenticate and use the site as expected.

## Failure Logs

The logs do not show anything besides a POST /forest/authentication request returning a 200 response.

## Context

Please provide any relevant information about your setup.

- Package Version:
- Express Version:
- Sequelize Version:
- Liana Version: 7.3.1
- Node version: 10.24.1
- Database Dialect: Postgres
- Database Version: 12
- Project Name: Oak National Academy

---

<div class="post-metadata">

**Author:** ![Sliman\_Medini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sliman_medini/32/19_2.png) [@Sliman\_Medini](https://community.forestadmin.com/u/Sliman_Medini)\
**Post date:** [May 14, 2021, 8:38am UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487/2 "2021-05-14T08:38:11Z")

</div>

Hi @Ian_Kynnersley,

Thanks for pointing out this detail.  
It’s perfect if your project is working now, I am asking my teammates what should be the cause of this.

---

<div class="post-metadata">

**Author:** ![Sliman\_Medini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sliman_medini/32/19_2.png) [@Sliman\_Medini](https://community.forestadmin.com/u/Sliman_Medini)\
**Post date:** [May 14, 2021, 9:39am UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487/3 "2021-05-14T09:39:21Z")

</div>

Hi again @Ian_Kynnersley,

You may have a static client ID, right? Please generate again your client ID.  
That’s why your old URL is validating authentication requests, and the new URL fails.

[js documentation](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v7#running-up-multiple-server-instances)  
[rails documentation](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-rails/upgrade-to-v6#setup-a-static-clientid)

Please note than your need a static client ID only when you scale your API on multiple instances. If it’s not the case (you have one API instance) but you have a `FOREST_CLIENT_ID` variable configured, you can just remove it.

Regards

---

<div class="post-metadata">

**Author:** ![Ian\_Kynnersley](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/ian_kynnersley/32/1218_2.png) [@Ian\_Kynnersley](https://community.forestadmin.com/u/Ian_Kynnersley)\
**Post date:** [May 14, 2021, 9:46am UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487/4 "2021-05-14T09:46:34Z")

</div>

Thanks @Sliman_Medini

Let me know if you make a fix that means I need to update my config to keep things working!

Ian

---

<div class="post-metadata">

**Author:** ![Sliman\_Medini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sliman_medini/32/19_2.png) [@Sliman\_Medini](https://community.forestadmin.com/u/Sliman_Medini)\
**Post date:** [May 14, 2021, 9:53am UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487/5 "2021-05-14T09:53:40Z")

</div>

@Ian_Kynnersley, the action is already on your side:

- Do you have a `FOREST_CLIENT_ID` defined in your environment variables?
- Yes, and you have multiple server instances (on production):
  - regenerate the `FOREST_CLIENT_ID` using the documentation link above

- Yes, and you have one server instance (on production):
  - drop the `FOREST_CLIENT_ID` which is useless in this case

Best

---

<div class="post-metadata">

**Author:** ![Ian\_Kynnersley](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/ian_kynnersley/32/1218_2.png) [@Ian\_Kynnersley](https://community.forestadmin.com/u/Ian_Kynnersley)\
**Post date:** [May 18, 2021, 6:07pm UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487/6 "2021-05-18T18:07:52Z")

</div>

Ah sorry - for some reason I only saw a notification for your first message and not the one about the CLIENT ID and I replied directly from the email notification 🤦‍♂️

I’ll look into this. I added the CLIENT\_ID because I couldn’t get the application to load without it and that fixed the issue at the time. I’ll try removing it again and see what happens.

---

<div class="post-metadata">

**Author:** ![Ian\_Kynnersley](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/ian_kynnersley/32/1218_2.png) [@Ian\_Kynnersley](https://community.forestadmin.com/u/Ian_Kynnersley)\
**Post date:** [May 20, 2021, 3:02pm UTC](https://community.forestadmin.com/t/application-url-variable-after-change-of-admin-backend-url/2487/7 "2021-05-20T15:02:57Z")

</div>

Thanks again for your help. The answer was to re-create the FOREST\_CLIENT\_ID with the new APPLICATION\_URL value. We are hosting the backend as an auto-scaling container in Cloud Run and this does seem to need the FOREST\_CLIENT\_ID to be there
