lowcoder-org / lowcoder

🔥 🔥 🔥 The Open Source Retool, Tooljet and Appsmith Alternative
https://www.lowcoder.cloud/
GNU Affero General Public License v3.0
931 stars 191 forks source link

[Bug]: OAuth: User cannot log in through different orgs #1284

Open jnewman-eti opened 2 weeks ago

jnewman-eti commented 2 weeks ago

Is there an existing issue for this?

Current Behavior

When a user logs into lowcoder through oauth provider into one org, logs out, and logs into a different org, this causes an error.

It seems the connection data stored in the db is not handled in a way that facilitates a user to log into different orgs.

Our setup: Keycloak with multiple orgs. Users can exist on both orgs. Lowcoder Generic Oauth Provider.

Expected Behavior

If a user logs out, and logs back in through a different org, the system should be able to handle this case without causing an error.

Steps to reproduce

Have a multitenant setup in your IDP. Register the same user in 2 orgs. Same name, email, etc.

Set up the Generic Oauth provider to authenticate through keycloak. Log into lowcoder using org 1. Log out of org 1. Log into org 2. This should cause an error.

Environment

Lowcoder version 2.4.x Keycloak IDP

Additional Information

No response

FalkWolsky commented 4 days ago

Question... Do you mean Lowcoder Orgs or KeyCloak Orgs (realms)?

dragonpoo commented 18 hours ago

@jnewman-eti I fixed the issue and it is not reproduced on my side. Hope you retest it. Thanks

dragonpoo commented 18 hours ago

After this PR is being merged, of course