Https://foo.com/auth/admin gives "invalid_request" error when attempting to login to the admin console on deployed keycloak

Version : 11.0

When I start my server locally, I’m able to visit localhost:8080/auth/admin and log into the admin console. However, when deployed, visiting https://foo.com/auth/admin results in a 400 error and a page that reads “We are Sorry” “Invalid Request”. Im using CloudFront as a reverse proxy and https://foo.com/auth/realms/master/.well-known/openid-configuration returns what appears to be a valid configuration with the correct SSL endpoints. The logs return the following error:
[org.keycloak.events] (default task-16) type=LOGIN_ERROR, realmId=master, clientId=null, userId=null, ipAddress=12.345.678.90, error=invalid_request

Did you find out the solution? I got the same issue, and seems that the CloudFront didn’t forward https protocol to KeyCloak.