Authentication issue after Forest Admin agent upgrade

Hello,

I am experiencing an authentication issue with my Forest Admin instance. After upgrading the agent from version 7.2.2 to version 9 and reinstalling dependencies, the server-side application appears to be working (logs indicate that authentication is successful and a JWT token is generated), but the user interface still displays an “Unable to authenticate you” error message.

Here are the steps I have already checked:

  1. The FOREST_ENV_SECRET key matches the one in the configuration on the interface.
  2. Dependency versions have been updated (uuid, superagent, core-js, etc.).
  3. The JWT token is generated with the correct values for audience and issuer .
  4. The .env file is correctly configured, including NODE_ENV=production .

Additionally, I can provide some code files if needed to help with the diagnosis. My environment is based on a VPS instance running Debian, with Node.js for the backend, and Forest Admin is used for data management. The project is configured with PostgreSQL as the database, and I am using express-jwt for handling JWT tokens.

Despite these checks, I am still receiving an error message indicating that authentication has failed.

Could you help me identify the cause of this issue and resolve it?

Thank you in advance for your assistance.

Best regards,

Hello @aurell04b,
Thanks you for your clear introduction :pray:

Could you provide detailed log from your Forest Admin frontend when the client tries to login?

Did you follow the v7 → v8 and v8 → v9 migrations guide?

Best regards,
Alban

Hello @Alban_Bertolini,

Thank you for your quick response and support.

Here is the additional information you requested:

  1. Regarding detailed logs from the Forest Admin frontend when the client tries to log in:
  • The user interface remains stuck on “Unlocking your data” for about 10 seconds before displaying the message “Unable to authenticate you”.
  • The full message is: “Unable to authenticate you. An error occurred during authentication. Please check that your admin backend is correctly configured and running.”
  • The server logs show that authentication is successful, a JWT token is correctly generated, but the user interface still shows “Unable to authenticate you”.
  • The frontend Forest Admin logs also show errors related to authentication, even though the tokens seem valid. I can share extracts of these logs if needed.
  1. I confirm that I have followed the migration guides for v7 → v8 and v8 → v9, step by step.

  2. Here are the server logs, with debug messages added:

Your application is listening on port 3310.
[forest] 🌳🌳🌳  NODE_ENV is not set to "development", the schema file will not be updated.
[forest] 🌳🌳🌳  Loading the current version of .forestadmin-schema.json file…
[forest] 🌳🌳🌳  Checking need for apimap update...
[forest] 🌳🌳🌳  No change in apimap, nothing sent to Forest.
Your admin panel is available here: https://app.forestadmin.com/projects
[CORS Debug] Origin: https://app.forestadmin.com
[CORS Debug] Origin allowed: https://app.forestadmin.com
[CORS Debug] Origin: https://app.forestadmin.com
[CORS Debug] Origin allowed: https://app.forestadmin.com
[JWT Middleware] Path: /forest/authentication
[After JWT Middleware] Path: /forest/authentication
[Ensure Authenticated] Path: /authentication
[POST /forest/authentication] Authentication requested
[POST /forest/authentication] Response: {"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYWRtaW4iLCJpYXQiOjE3MzMzMTM1MzYsImV4cCI6MTczMzM0MjMzNiwiYXVkIjoiaHR0cHM6Ly9hcHAuZm9yZXN0YWRtaW4uY29tIiwiaXNzIjoib3JpZ28ifQ.Ip0JdkJvdzucgnPW4_PcaqkIuUOtuggG8J_6zjY3P68","message":"Authentication successful"}
::ffff:127.0.0.1 - - [04/Dec/2024:11:58:56 +0000] "POST /forest/authentication HTTP/1.1" 200 265 "https://app.forestadmin.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"
[CORS Debug] Origin: https://app.forestadmin.com
[CORS Debug] Origin allowed: https://app.forestadmin.com
[CORS Debug] Origin: https://app.forestadmin.com
[CORS Debug] Origin allowed: https://app.forestadmin.com
[JWT Middleware] Path: /forest/authentication
[After JWT Middleware] Path: /forest/authentication
[Ensure Authenticated] Path: /authentication
[POST /forest/authentication] Authentication requested
[POST /forest/authentication] Response: {"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYWRtaW4iLCJpYXQiOjE3MzMzMTM1MzYsImV4cCI6MTczMzM0MjMzNiwiYXVkIjoiaHR0cHM6Ly9hcHAuZm9yZXN0YWRtaW4uY29tIiwiaXNzIjoib3JpZ28ifQ.Ip0JdkJvdzucgnPW4_PcaqkIuUOtuggG8J_6zjY3P68","message":"Authentication successful"}
::1 - - [04/Dec/2024:11:58:56 +0000] "POST /forest/authentication HTTP/1.1" 200 265 "https://app.forestadmin.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"

Thank you in advance for your help.

Best regards,
Aurelien

:pray: Thanks you very much.

Could you share your logs from your Forest Admin network?
I would like to see the auth and callback responses :pray:

I’m not sure what you’re asking but I have this


I would like to see if a request fails from your network and get the logs to try to understand your issue :/.
Do you have any request that fails to share? :slight_smile:

Not that i don’t know but if you want other access or data in order to access the project and inspect the problem i remain at your disposal. :smiley:
The problem is quite urgent as forestadmin is used as a pillar software in a company which has been at a standstill since this shutdown.

We recently sent an email to schedule a tech session and wanted to confirm if you have received it. Could you please let us know at your earliest convenience?