Hi,

I am working on issue[1]. According to the existing implementation the
constant "LDAPConstants.USER_CONTEXT_NAME" has been used in several places
to build OrganizationalSubContextAttribute. If the tenant-mgt.xml is
updated to read value of property "OrganizationalSubContextAttribute" as
follows, (current implementation reads only "ou" value: <Property
name="OrganizationalSubContextAttribute">ou</Property> )

                      <Property
name="OrganizationalSubContextAttribute">ou=users</Property>

Implementation should updated as below,

   1. CommonHybridLDAPTenantManager.java[3] (line 177),
   CommonLDAPRealmConfigBuilder.java[2] (line 120) and
   FileSystemRealmConfigBuilder.java[4] (line 123) should updated accordingly.
   Is this a proper solution? Is there a limited set of values that can be set
   to OrganizationalSubContextAttribute?
   2. It seems line 161 of [3] should read the value
   "PROPERTY_ORGANIZATIONAL_ATTRIBUTE" instead of "
   PROPERTY_ORG_SUB_CONTEXT_ATTRIBUTE". This works fine as the default
   configuration set values of both properties to "ou"

 eg: current tenant-mgt.xml contains properties below;

           <Property name="OrganizationalAttribute">ou</Property>
           <Property
name="OrganizationalSubContextObjectClass">organizationalUnit</Property>
           <Property name="OrganizationalSubContextAttribute">ou</Property>

Thus the correction should be to change,

String organizationNameAttribute = tenantMgtConfig.getTenantStoreProperties
().get( UserCoreConstants.TenantMgtConfig.PROPERTY_ORG_SUB_CONTEXT_ATTRIBUTE
);

to

String organizationNameAttribute = tenantMgtConfig.getTenantStoreProperties
().get( UserCoreConstants.TenantMgtConfig.PROPERTY_ORGANIZATIONAL_ATTRIBUTE
);

[1] https://wso2.org/jira/browse/CARBON-14863
[2]
https://github.com/wso2-dev/carbon4-kernel/blob/master/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/config/multitenancy/CommonLDAPRealmConfigBuilder.java
[3]
https://github.com/wso2-dev/carbon4-kernel/blob/master/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/tenant/CommonHybridLDAPTenantManager.java
[4]
https://github.com/wso2-dev/carbon4-kernel/blob/master/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/config/multitenancy/FileSystemRealmConfigBuilder.java

Thanks,
Nipuni
-- 
Nipuni Perera
Software Engineer; WSO2 Inc.; http://wso2.com
Email: nip...@wso2.com
Git hub profile: https://github.com/nipuni
Mobile: +94 (71) 5626680
<http://wso2.com>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to