Reputation: 582
Is it possible to distinguish whether the user is from the primary userstore or a secondary user store? I would like to prevent the user from modifying his profile if he is from a secondary userstore.
Upvotes: 1
Views: 423
Reputation: 478
As explained in the above answer if you have a secondary user store set up with the name "WSO2.COM" and a user with name user@tenant1.com. Actual username to be used to login should be "WSO2.COM/user@tenant1.com". You can find more information on how to set up the secondary user store please refer to links [1],[2]. If would like to prevent user to modifying the profile. Please enable the read-only mode as explained in [2].
[2] http://pushpalankajaya.blogspot.com/2013/09/how-to-write-custom-user-store-manager.html
Cheers, Pubudu.
Upvotes: 0
Reputation: 1951
If the user is from secondary user store, his user name will contain the user store domain he contains.
The username follows following format,
userstore/username@tenantdomain
You can get user store domain from this.
In primary user store users, userstore part will not be contained in username.
Upvotes: 1