I have two servers running RAD Server with Apache, one with Centos 7 and one with Centos 9. On the server with Centos 7 I experience similar problems as you with a custom login resource, but it works fine on the Centos 9 server. I don't know the solution to this problem, but a workaround is to call QueryUserName on the LEMSAPI variable. The downside is that this is a potentially security risk because then you have to give all users access to Users.GetUsers in emsserver.ini as the constructor of the TEMSInternalAPI.Create(const AContext: TEndpointContext) uses the context of the caller (which is not logged in)