Unable to login to foreman when user is linked to LDAP

Problem:
I have a Foreman 3.8 server connected to an external postgresql datbase, primary and replica, I am using makara gem 0.51 to control data flow to the primary and replica. This conmination seems to be working fine no errors etc reported…

My issue is that I have a Foreman account kp802105 that is controlled within Foreman via LDAP authentication, but I am unable to login and I can see in the foreman log.
‘Can’t verify CSRF token authenticity.’
and I fail to login.

But if I try an account that is Local in Foreman, then I can login with no issues.

Expected outcome:
Able to login to server with a LDAP bound account
Foreman and Proxy versions:
3.8
Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:
2024-03-01T10:53:56 [I|app|2c1bd8c3] Processing by UsersController#login as HTML
2024-03-01T10:53:56 [I|app|2c1bd8c3] Parameters: {“login”=>{“login”=>“kp802105”, “password”=>“[FILTERED]”}, “authenticity_token”=>“NC5hOm59hC3h6-8wrWgmg4tLOMhHN3jGXJSZ-oJq316HEH4IlAbGXj4XxTsGsY3G0n0UXtfgJUPafONOX7wR6w”}
2024-03-01T10:53:56 [W|app|2c1bd8c3] Can’t verify CSRF token authenticity.

Update to this, I have found that in my LDAP definition in Foreman if I disable the setting

External user groups will be synced on login, else relies on periodic cronjob to check group membership

then I am able to login. so this has sorted my issue.
Regards
kevin