Hi,
I have two user sources configured.
- user1, failover user source is configured to use "user2"
- user2
project 1 is using user1 as user source.
When I login the project 1 using user from user2, it can login and display correctly.
But is there any system tag that states the name of the current user "user source"?
I can find the user name and its role under the system/user folder, but not the user source.
No, this isn't directly exposed. You could query system.user.getUser with your two possible user sources and see which one returns a user object for the known username?
SoSounds
Sounds like a good candidate for a suggested feature then. @chaoliang you can submit that here so hopefully they include it one day, in the meantime you can try PGriffith's workaround.
Old thread, but getPath() in the user object may be what you're looking for. It returns a qualified path with the userSource. For example, a user "admin" in the default user source returns the following:
usr-prov:default:/usr:admin
I've also noticed that specifically with LDAP user sources, if the user source is configured with a soft failover to a secondary user source, system.user.getUsers() will display the results of the failover user source if the primary user source is not available.
We see this a lot when a remote site connection to LDAP is unavailable, so using getPath() helps us determine if the returned results match the userSource we were originally requesting.
User object scripting reference