Context
My application runs well on development and production using liana v6.7
Since I upgraded to liana v7 using this tutorial, I am not able to connect to production environment (but it works fine on development).
Production is hosted on AWS with a load balancer + ECS containers.
The error I get is the following =>
GET: https://<My_Production_URL>
/forest/authentication/callback?code=xxxxxxxxxxxxxxx
{"error":"InvalidClientIdError","error_description":"The provided client id does not match the id received at first place."}
Why it fails
Liana v7 introduces a new auth flow to avoid entering twice your password:
- when connecting forest,
- when entering the app (Liana v7 removes this step)
This new flow uses OpenID mechanism and the usage of CLIENT_ID
variable.
This CLIENT_ID is generated by default per instance of your app.
So, in a context of a load balancer, the CLIENT_ID will change when you hit a different instance.
This is why you get an error during the flow: the CLIENT_ID is not consistent across the different calls to your backend.