Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Tomasz M Lipinski
476
Views
4
Comments
Two users with the same Username from different tenants
Question
Hi,
I'm using the Users user provider. Let's assume that there are two users, with the same Username but in two different tenants. Let's assume also, that I know which tenant is to be used. The question is: how can I force Users (I mean: the provider, not the application) to select and check the appropriate user?
Some example to be clearer:
- there is a user "AUser" in the tenant "Users"
- there is also a user "AUser" in some other tenant "SomeTenant"
My application accepts users from SomeTenant. When the user enters his login and password:
- I switch the tenant to SomeTenant, using TenantSwitch
- I try to login the users using the User_Login action
User_Login seems to check just the first "AUser" it finds. In some cases it is the user from SomeTenant, in other cases - from Users.
And it is just them same, when I try to login AUser in the Users application.
What could be the solution?
Regards
Tomasz
João Pedro Abreu
Staff
Greetings,
You'll need to implement your own login logic, instead of using the action from users. It should be fairly simple:
Switch to the target tenant
Query the Users entity to validate the inserted credentials
Use the Login action from System to login, if the credentials are correct
3 replies
Last reply 21 Jun 2016
Show thread
Hide thread
Tomasz M Lipinski
João Pedro Abreu
wrote:
Greetings,
You'll need to implement your own login logic, instead of using the action from users. It should be fairly simple:
Switch to the target tenant
Query the Users entity to validate the inserted credentials
Use the Login action from System to login, if the credentials are correct
Well, I can use LoginPassword also. But there are still 2 questions:
how LoginPassword works in the context of the integration with AD?
how can "AUser" login to the Users application ?
Regards
Tomasz
João Pedro Abreu
Staff
Tomasz M. Lipinski
wrote:
Well, I can use LoginPassword also. But there are still 2 questions:
how LoginPassword works in the context of the integration with AD?
how can "AUser" login to the Users application ?
As far as I can tell, when you are authentication against an external user provider, such as AD, you should use
Login
and not
LoginPassword
. Login password will validate the user's local password.
In order to login to the Users application, "AUser" should use a login screen that forces a tenant switch to the Users tenant. I don't think its original login was designed to allow many users with the same username.
Now that i think of it, all the multi-tenant applications I've seen so far had their own user provider and that's probably why!
Tomasz M Lipinski
João Pedro Abreu
wrote:
As far as I can tell, when you are authentication against an external user provider, such as AD, you should use
Login
and not
LoginPassword
. Login password will validate the user's local password.
OK,
Login
, but together with some action that asks AD to check the password.
In order to login to the Users application, "AUser" should use a login screen that forces a tenant switch to the Users tenant. I don't think its original login was designed to allow many users with the same username.
My experiments say, that Users application just doesn't work with multiple usernames.
Now that i think of it, all the multi-tenant applications I've seen so far had their own user provider and that's probably why!
I think that it is the key answer :-)
Thanks for all.
Regards
Tomasz
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...