简体   繁体   English

为WSO2构建自定义用户存储管理器

[英]Building a customized user store manager for WSO2

I am trying to configure WSO2 to authenticate a user via LDAP, but then augment the user with attributes stored elsewhere (exploring some legacy integration-type scenarios, so moving everything to LDAP really isn't in the cards). 我正在尝试配置WSO2以通过LDAP对用户进行身份验证,但随后使用存储在别处的属性来扩充用户(探索一些遗留的集成类型方案,因此将所有内容移动到LDAP实际上并不在卡中)。

The user attribute documentation ( https://docs.wso2.com/display/IS560/Managing+User+Attributes#ManagingUserAttributes-Writingcustomattributes ) indicates that this is best accomplished by writing a custom user store and https://docs.wso2.com/display/IS560/Writing+a+Custom+User+Store+Manager#WritingaCustomUserStoreManager-ImplementingacustomJDBCuserstoremanager lists out AbstractUserStoreManager as the class to extend and work with (though, in all probability, we would extend a subsclass). 用户属性文档( https://docs.wso2.com/display/IS560/Managing+User+Attributes#ManagingUserAttributes-Writingcustomattributes )表示通过编写自定义用户存储和https://docs.wso2可以最好地完成此操作。 com / display / IS560 / Writing + a + Custom + User + Store + Manager#WritingaCustomUserStoreManager-ImplementingacustomJDBCuserstoremanager列出了AbstractUserStoreManager作为扩展和使用的类(尽管很可能,我们会扩展一个子类)。

The problem I am running into as I am rummaging through the WSO2 IS code on github is that I cannot seem to find a class by this name or methods by the names mentioned in the documentation. 我正在通过github上的WSO2 IS代码进行搜索时遇到的问题是我似乎无法通过文档中提到的名称通过此名称或方法找到类。 My guess would be that sometime between 4.4-ish and present (5.6 being the version I downloaded as an MSI) that the integration point changed. 我的猜测是,在4.4-ish和现在之间(5.6是我作为MSI下载的版本),集成点发生了变化。 Has it changed? 它改变了吗? If not, where should I be looking for the classes to extend? 如果没有,我应该在哪里寻找扩展课程?

You can look in the wso2-carbon-kernal for the classes. 您可以在wso2-carbon-kernal中查找课程。 For IS 5.6 try looking in the 4.4.x branch of carbon-kernel 对于IS 5.6,请尝试查看碳内核的4.4.x分支

https://github.com/wso2/carbon-kernel/tree/4.4.x/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core https://github.com/wso2/carbon-kernel/tree/4.4.x/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core

如果您使用LDAP进行身份验证,我建议您扩展ReadOnlyLDAPUserStoreManager并覆盖getUserProperties方法(或类似的东西,我现在不记得方法名称)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM