# Enabled to Reach Remote Remote Environment

**URL:** https://community.forestadmin.com/t/enabled-to-reach-remote-remote-environment/5733
**Category:** Help me!
**Tags:** setup, dashboard
**Created:** [December 21, 2022, 10:57am UTC](https://community.forestadmin.com/t/enabled-to-reach-remote-remote-environment/5733 "2022-12-21T10:57:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Luftedar](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Luftedar](https://community.forestadmin.com/u/Luftedar)
#### Post date: [December 21, 2022, 10:57am UTC](https://community.forestadmin.com/t/enabled-to-reach-remote-remote-environment/5733/1 "2022-12-21T10:57:36Z")

</div>

## Feature(s) impacted

I’m having trouble to accessing one of our remote environments. Our team has two environments one of them production and the other one is staging(pre-production). Only one person can access the staging others in the team can’t access.

## Observed behavior

Unable to reach staging environment only project owner can access.

## Expected behavior

Being able to access staging environment.

## Failure Logs

Unable to authenticate you error pops as below:

 ![Screen Shot 2022-12-21 at 13.28.09](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/6/6862e598f78b1b4c30863214c80548755cd1f8a1.png)  
Get 500 error in this request. …/forest/authentication/callback?error=invalid\_grant  
 ![Screen Shot 2022-12-21 at 13.28.33](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/0/04d3689b3c5a0fc05b0f4991d2486d16aca44f9f.png)

 ![Screen Shot 2022-12-21 at 13.32.30](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/bc09a70e7ebd64e155e3eba1a70df64a29502cee.png)

## Context

- Team name: Operations
- Environment name: Staging
- Agent type & version: Rails
- Recent changes made on your end if any: Occured after the project owner created the team.

---

<div class="post-metadata">

### Author: ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)
#### Post date: [December 21, 2022, 12:39pm UTC](https://community.forestadmin.com/t/enabled-to-reach-remote-remote-environment/5733/3 "2022-12-21T12:39:19Z")

</div>

Hello @Luftedar,

Can you please share with me the request parameters and response bodies of the following calls:

- `https://api.forestadmin.com/oidc/auth`
- `[your agent's url]/forest/authentication/callback`

Also, can you please share with me:

- the last 2 characters of the environment secret that is configured on your staging environment,
- if a value is defined for the config parameter `ForestLiana.forest_client_id`
- the value used as `ForestLiana.application_url` in your staging environment

Thanks

---

<div class="post-metadata">

### Author: ![Luftedar](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Luftedar](https://community.forestadmin.com/u/Luftedar)
#### Post date: [December 27, 2022, 7:50am UTC](https://community.forestadmin.com/t/enabled-to-reach-remote-remote-environment/5733/4 "2022-12-27T07:50:35Z")

</div>

- [https://api.forestadmin.com/oidc/auth?client\_id=](https://api.forestadmin.com/oidc/auth?client_id=)CLIENT\_ID&redirect\_uri=[https://admin-stg.branchsight.com/forest/authentication/callback&response\_type=code&scope=openid](https://admin-stg.branchsight.com/forest/authentication/callback&response_type=code&scope=openid) email profile&state={“renderingId”=\>133387}

Returns 302

- forest/authentication/callback: { status: 500, detail: “‘code’ required.” }  
error\_description: You are not allowed to access to this client

- Environment secret last two digits: 95

- forest\_client\_id: CLIENT\_ID

- url: [https://admin-stg.branchsight.com](https://admin-stg.branchsight.com)

---

<div class="post-metadata">

### Author: ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)
#### Post date: [December 27, 2022, 11:42am UTC](https://community.forestadmin.com/t/enabled-to-reach-remote-remote-environment/5733/5 "2022-12-27T11:42:21Z")

</div>

Hello @Luftedar,

As @GuillaumeGautreau is off in Christmas holidays I will take on this subject.

> [@Luftedar](#):
>
> Environment secret last two digits: 95

I double check, it seems to be the right one.

> [@Luftedar](#):
>
> forest\_client\_id: CLIENT\_ID (as been removed to anonymize it, you should not share this value for security reason)

This is not the right `clientId` for this environment for sure, it is the one from your **production environment**. You need to have different client ids betweens your environment. You might have copied it by mistake.

You can either [enable caching and remove the forest\_client\_id definition for this environment](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-rails/upgrade-to-v6#enable-caching) (the clientId will be automatically generated) or replace the one you’ve configured with a [newly created as described here](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-rails/upgrade-to-v6#setup-a-static-clientid) and below.

> **CURL command to generate forest\_client\_id (not recommended way)**
>
> You only need to change the FOREST\_ENV\_SECRET by your own env secret. The response will contain a valid **forest\_client\_id**.
> 
> ```javascript
> curl -H "Content-Type: application/json" \
> -H "Authorization: Bearer FOREST_ENV_SECRET" \
> -X POST \
> -d '{"token_endpoint_auth_method": "none"}' \
> https://api.forestadmin.com/oidc/reg
> 
> ```

> **As a side note** : _ForestLiana.application\_url_ and _ForestLiana.forest\_client\_id_ are totally removed starting from [liana version 7.7.0](https://github.com/ForestAdmin/forest-rails/pull/582) to ease environment setup. 🙏

Lets us know if it helps.

Kind regards,  
Morgan

---

<div class="post-metadata">

### Author: ![Luftedar](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Luftedar](https://community.forestadmin.com/u/Luftedar)
#### Post date: [August 5, 2024, 8:18pm UTC](https://community.forestadmin.com/t/enabled-to-reach-remote-remote-environment/5733/6 "2024-08-05T20:18:43Z")

</div>

Hi team!

Sorry for the late reply. Due to change in our company emails, I have missed your replies.  
We have solved the problem by removing forest\_client\_id.

Thanks for your help
