backend icon indicating copy to clipboard operation
backend copied to clipboard

Login issue with secondary organization (org2.primarydomain.xx)

Open ivan1823 opened this issue 8 months ago • 10 comments

I'm using version 1.29.3 with a primary organization (primarydomain.xx) and everything works as expected.

We’ve recently tried to set up a secondary organization (org2.primarydomain.xx), but I’m unable to log in through it.

Is there any additional configuration needed to enable authentication via secondary organizations? Could we be missing a setup step?

Context:

Version: 1.29.3

Primary org (working): primarydomain.it

Secondary org (failing): org2.primarydomain.it

Thanks in advance for your support!

ivan1823 avatar Apr 22 '25 11:04 ivan1823

What exactly is not working? Can you describe the steps you took to set up the secondary domain? Do you see any errors in the logs?

virtualzone avatar Apr 25 '25 10:04 virtualzone

We tried to create a secondary organization (org2.primarydomain.it) via the "Organizations" section by clicking "New", filling out all required information, and setting up an admin account like [email protected] with a password. However, when trying to log in with this new admin account, the login fails — it seems as if the system is still trying to authenticate against the primary organization instead of the secondary one. No meaningful errors are shown in the logs.

ivan1823 avatar Apr 28 '25 09:04 ivan1823

You'll need to navigate your browser to org2.primarydomain.it and log in there. The username is irrelevant for the organization the application selects to log in to, but the organization's domain. We've changed the organization-based login behaviour in version 1.25.

virtualzone avatar Apr 28 '25 18:04 virtualzone

Hello,

As you mentioned, the expected behavior after the changes introduced in version 1.25 is that you should navigate your browser to org2.primarydomain.it and log in there.

We created the domain entry org2.primarydomain.it as suggested. However, based on the database dump analysis, it appears that there is no corresponding entry for org2 in the organizations_domains table — specifically, no row linking the new domain to the organization_id of org2.

Moreover, checking the database, the only place where the organization_id of org2 appears (other than in the organizations table itself) is in the settings table. This suggests that the necessary association between the domain and the organization may not have been correctly set up.

Could you please confirm whether additional configuration steps are required, such as manually inserting the domain mapping into the organizations_domains table?

Thank you!

ivan1823 avatar Apr 29 '25 13:04 ivan1823

You're right, no domain is added, this is why you're experiencing these issues. I'd recommend setting up a separate Seatsurfing instance with its own primary domain. Alternatively, you can add the entry for your org2 domain to the organizations_domains table.

virtualzone avatar Apr 30 '25 11:04 virtualzone

Thanks! So add the entry for my org2 domain to the organizations_domains table should be enough right?

ivan1823 avatar Apr 30 '25 12:04 ivan1823

Yes!

virtualzone avatar Apr 30 '25 14:04 virtualzone

You mentioned that I should manually insert the domain in the organizations_domains table. However, I'm not entirely sure what the purpose of this verify_token is, or how it should be generated. Could you please clarify?

For reference, here’s the example I was looking at:

pgsqlCopiaModificaCOPY public.organizations_domains (domain, organization_id, active, verify_token) imtlucca.it 40dea2bb-820a-441a-9353-d6b1971d81dd t cb8e412a-b6dc-4f0a-862b-710a202d7005

Is the verify_token something I need to generate myself (e.g., a UUID or some hash), or is it provided by another part of the system?

Thanks in advance!

ivan1823 avatar May 05 '25 12:05 ivan1823

The verify_token is a random UUID used for verifying the domain's ownership.

virtualzone avatar May 05 '25 19:05 virtualzone

In addition to that, we resolved the issue by manually adding the new administrator user. Do you think this manual modification could cause any compatibility issues with future updates?

ivan1823 avatar May 07 '25 09:05 ivan1823