K
Kinde10mo ago
Pablo More

Personal account and organizations

Hello, I am having the use case of customers having their own account (in which org_code should not be present on the access token) and being able to switch organizations as well if they need. Given a user X that has an organization FOO and BAR, I want the user to always login without org when going through the login page and only be able to switch using a drop-down (that is described in your site and works well). The problem is that whenever I am login-in I always get prompt to which organization I want to log in instead. Can I somehow force him to login not into any organization and then make him switch accordingly based in the org_code parameter?? I tried sending org_code to some invalid number to see if I can just force it through but it does not work
4 Replies
Oli - Kinde
Oli - Kinde10mo ago
Hey @Pablo More, Thanks for reaching out and your extensive explanation of your ideal experience. In your case of "user X that has an organization FOO and BAR", do you have a preference of whether the user would initially log into FOO or BAR? Because the user would initially need to be logged into an organization and then switch between them. You could the following workaround. If, for example, you don't mind which organization they log into first, then let's log them into FOO first. You could send the user to the FOO specific organization login screen (they won't be presented with an org switcher). Here is a guide on how to achieve this. Would this solve your use-case?
Kinde Docs
Kinde organizations for developers - Build on Kinde - Help center
Our developer tools provide everything you need to get started with Kinde.
Pablo More
Pablo MoreOP10mo ago
Hi @Oli - Kinde thanks for the quick reply. Unfortunately that wont solve it. To give more sense to my scenario lets imagine a business like Github. You have your account and you can create your own repos and then you can be part of an organization and access the org's repos. When I log in I want to log in as my "Personal tenant" and not default directly to any of the organizations. Of course once logged-in the customer can change the tenant but at first the tenant should be the personal one. One thing I thought was to use the default organization as "Personal tenant" and use its org_code for people to log in. But there are two problems: - Login screens says "Personal tenant" on the top (I know I can bring my own screen but that is not the idea) - It is easier for me to do a convinience func such as jwt.claims.org_code == "" then I know that the customer is under the personal tenant, but now I should do something like jwt.claims.org_code == "org_fa93ca16058" which can change in each environment and I need to inject that everywhere where I work with the token.
Oli - Kinde
Oli - Kinde10mo ago
Hey @Pablo More, Thanks for elaborating more on your use-case, and I understand the pain-points trying to achieve your use-case with the current Kinde platform. I have noted down your use-case, but for now I would suggest exactly what you said above, have each user be assigned to a "Personal tenant" org and directly sign your users into that org. Yes it will say "Personal tenant" but like you said, this can be custom sign-in page. Please let me know if there is anything else I can help you with.
ev_kinde
ev_kinde10mo ago
This is an interesting question @Pablo More, is this something like a concept of a primary organization for a user?
Want results from more Discord servers?
Add your server