Wai Yan
Wai Yan

Reputation: 582

WSO2 Identity Server - distinguish users from Primary userstore and secondary userstore

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

Answers (2)

Pubudu
Pubudu

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].

[1] https://medium.com/@pubududp/how-to-use-active-directory-as-a-secondary-user-store-in-tenant-mode-for-wso2-products-f49ac4829e41#.2ujax4wud

[2] http://pushpalankajaya.blogspot.com/2013/09/how-to-write-custom-user-store-manager.html

Cheers, Pubudu.

Upvotes: 0

Chamila Wijayarathna
Chamila Wijayarathna

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

Related Questions