Ok we fixed the problem and are thinking it's a kind of a bug in outsystems.
The funny thing is it worked at our Acceptance server without a problem, just on dev its a problem. I did a compare of both environments and found out in the espace system table the tenant was still on the users espace. Searching a bit more turned out the espace_version system table did show the correct tenant name and key on our app. After changing the tenant name and key in the espace system table, republish both apps and testing again it now worked correctly. the user is now generated with the correct tenant in the user table. We also fixed all the users by updating the tenants for the correct users the our userprovider tenant id and now everything works.
Now the why .. I suspect OutSystems will not change the tenant on a running system because then all data will be invissible if you don't change all tenant id's .. maybe it's not working by design. But would be nice if this was displayed in a message when you change the tenant.
The funny thing is it worked at our Acceptance server without a problem, just on dev its a problem. I did a compare of both environments and found out in the espace system table the tenant was still on the users espace. Searching a bit more turned out the espace_version system table did show the correct tenant name and key on our app. After changing the tenant name and key in the espace system table, republish both apps and testing again it now worked correctly. the user is now generated with the correct tenant in the user table. We also fixed all the users by updating the tenants for the correct users the our userprovider tenant id and now everything works.
Now the why .. I suspect OutSystems will not change the tenant on a running system because then all data will be invissible if you don't change all tenant id's .. maybe it's not working by design. But would be nice if this was displayed in a message when you change the tenant.