Session Token credentials invalid after 5 minutes with User_External

Dear community,
Iā€™m new to nextcloud.

I installed Nextcloud on Raspberry PI, small environment. Whenever I activate the UserExternal, my browser connection is treset after around 5 minutes with the message ā€œSession token credentials are invalidā€.

I did a lot of several tests at the end the problem is always there in case I use user_backends with user Externals. I checked two ways

  1. IMAP
  2. SSH

Both of them shows the same problem and the same message in the log. In case I change the loglevel to more detailed view, there is nothing more - only
ā€œSession token credentials are invalidā€

My Config for the backend looks:

'user_backends' =>
   array (
     array (
       'class' => '\OCA\UserExternal\IMAP',
       'arguments' => array (
         '127.0.0.1', 143,'','',true,false
       ),
     ),
   ),

In case I delte this, it works as expected. Iā€™m also able to login with the imap backend, works OK.

Nextcloud version: 29.0.4.1
External user Authentication: 3.3.0
PHP 8.2.20

Adding lifetime cookies in the config doesnā€™t change anythink.
Any Ideas where I can look to find further details?

FYI they are working on getting 3.4.0 released:

Especially to deal with some open issuesā€¦

If you use a native Nextcloud user, you donā€™t have this problem?

Yes, youā€™re right, in case I use the native user, the problem is gone.
Now I change the password hash from araon to sha256.
In case I do so my password in the database can be copied with a database trigger to my /etc/shadow.
Cyrus also use the Unix passwd (with Pam). After this was done, the user can now use the same password for mail(Cyrus) and Nextcloud.

Seems a little bit complicated, overall I think it decouple me from further changes with the external implementation.