Unable to authenticate [express - mongoose]

Expected behavior

I can proceed to forest admin panel.

Actual behavior

I’m getting error about authentication.

Failure Logs

My server is running on port 5000, however the authentication request from callback is on port 3310.



Hello @AleksandraKaminska,

Can you share with us the name of your project and the environment you are working on?

Did you define the APPLICATION_URL environment variable to https://localhost:5000?

Hello Guillaume,
project name: Migit,
development environment.
Yes I did, I put all listed config vars to my .config.env file.

Thanks for the details.

Can you please share the response to the first request POST to /forest/authentication on your local server?



I have set up both FOREST_ENV_SECRET and FOREST_AUTH_SECRET environment vars.


It seems that the environment variable APPLICATION_URL is not correctly set to http://localhost:5000. As far as I can see the client id has been generated for http://localhost:3310 which means that your agent sent this value to the server.

The callbackUrl is directly coming from APPLICATION_URL, indicating that this environment variable is not correctly set.

Can you please share with us the content of your .env file, with obfuscated values for the FOREST_ENV_SECRET and FOREST_AUTH_SECRET ?

I have setup envs as I described above. Everything copied directly to my .env file from your setup guide. APPLICATION_URL has value http://localhost:5000. You can see attached the first screen with response 200 to http://localhost:5000/forest/authentication. Anyway I moving my app to postgres, so I can’t attach more screens. Fyi your setup guide for postgres works for me.