创建自定义用户存储管理器时遇到问题[WSO2 API Manager 1.9.1]

时间:2016-01-14 11:14:29

标签: wso2 wso2-am

我对WSO2完全不熟悉。我必须使用wso2 api manager创建自定义用户存储管理器。虽然有些词我正面临例外,

TID:[0] [AM] [2016-01-14 16:19:57,532] INFO {org.wso2.carbon.databridge.agent.thrift.AgentHolder} - 创建了代理! {} org.wso2.carbon.databridge.agent.thrift.AgentHolder
TID:[0] [AM] [2016-01-14 16:19:57,536] INFO {org.wso2.carbon.databridge.agent.thrift.internal.AgentDS} - 已成功部署代理客户端{org.wso2.carbon。 databridge.agent.thrift.internal.AgentDS}
TID:[0] [AM] [2016-01-14 16:19:59,608] ERROR {org.wso2.carbon.user.core.common.DefaultRealmService} - 无法初始化领域。 {} org.wso2.carbon.user.core.common.DefaultRealmService
org.wso2.carbon.user.core.UserStoreException:org.wso2.sample.user.store.manager.CustomUserStoreManagerType class java.lang.ClassNotFoundException

我已将user-mgt.xml更新为

 <UserStoreManager class="org.wso2.sample.user.store.manager.CustomUserStoreManager">
        <Property name="TenantManager">org.wso2.carbon.user.core.tenant.JDBCTenantManager</Property>
    <Property name="ReadOnly">false</Property>
        <Property name="MaxUserNameListLength">100</Property>
        <Property name="IsEmailUserName">false</Property>
        <Property name="DomainCalculation">default</Property>
        <Property name="PasswordDigest">SHA-256</Property>
        <Property name="StoreSaltedPassword">true</Property>
        <Property name="ReadGroups">true</Property>
    <Property name="WriteGroups">true</Property>
        <Property name="UserNameUniqueAcrossTenants">false</Property>
        <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
        <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
    <Property name="UsernameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\&lt;&gt;,\'\"]{3,30}$</Property>
    <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
    <Property name="RolenameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\&lt;&gt;,\'\"]{3,30}$</Property>
    <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
        <Property name="UserRolesCacheEnabled">true</Property>
        <Property name="MaxRoleNameListLength">100</Property>
        <Property name="MaxUserNameListLength">100</Property>
    <Property name="SharedGroupEnabled">false</Property>
        <Property name="SCIMEnabled">false</Property>
    </UserStoreManager>

我还注册了服务,

公共类CustomUserStoreMgtDSComponent {

 private static Log log = LogFactory.getLog(CustomUserStoreMgtDSComponent.class);
 private static RealmService realmService;

    protected void activate(ComponentContext ctxt) {
        log.info("Custome Component activated..");
        CustomUserStoreManager customUserStoreManager = new CustomUserStoreManager();
        ctxt.getBundleContext().registerService(UserStoreManager.class.getName(), customUserStoreManager, null);
        log.info("CustomUserStoreManager bundle activated successfully..");
    }

    protected void deactivate(ComponentContext ctxt) {
        if (log.isDebugEnabled()) {
            log.debug("Custom User Store Manager is deactivated ");
        }
    }

    protected void setRealmService(RealmService rlmService) {
          realmService = rlmService;
    }

    protected void unsetRealmService(RealmService realmService) {
        realmService = null;
    }

}

我还在dropins文件夹中添加了sample-store.jar。

是否有任何参考指南/链接通过wso2 api manager创建自定义用户存储管理器?

任何帮助都会非常明显。

0 个答案:

没有答案