简体   繁体   English

WSO2用户自我注册

[英]WSO2 User self registration

I am trying to call the WSO2 Identity server web service using a java client. 我正在尝试使用Java客户端调用WSO2身份服务器Web服务。

public static void main(String[] args) {
    UserInformationRecoveryService service = new UserInformationRecoveryService();
    UserInformationRecoveryServicePortType port = service
            .getUserInformationRecoveryServiceHttpsSoap11Endpoint();

    BindingProvider prov = (BindingProvider) port;

    prov.getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "admin");
    prov.getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "admin");

    try {

        List<UserIdentityClaimDTO> list = port
                .getUserIdentitySupportedClaims("http://schemas.xmlsoap.org/ws/2005/05/identity");
        System.out.println(port
                .registerUser("user96", "Asdf@234", list, "profile", "")
                .getUserId().getValue());

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

When I pass in password not matching the password criteria, I can see the error message in WSO2 logs: 当我输入不符合密码条件的密码时,我可以在WSO2日志中看到错误消息:

Password pattern policy violated. 违反了密码格式政策。 Password should contain a digit[0-9], a lower case letter[az], an upper case letter[AZ], one of !@#$%&* characters 密码应包含数字[0-9],小写字母[az],大写字母[AZ],!@#$%&*字符之一

But when the password is compliant, I just get an error 但是当密码符合要求时,我只会收到一个错误

org.wso2.carbon.identity.mgt.services.UserInformationRecoveryServiceIdentityMgtServiceException_Exception: Error occurred while adding user : user96 org.wso2.carbon.identity.mgt.services.UserInformationRecoveryServiceIdentityMgtServiceException_Exception:添加用户时发生错误:user96

Nothing in WSO2 log and the user is not added. WSO2日志中没有任何内容,并且未添加用户。 Any clue as to what is wrong here? 关于这里有什么问题的任何线索吗?

Better enable debug logs in the log configuration file. 更好地在日志配置文件中启用调试日志。 [IS_Home]/repository/conf/log4j.properties Add the following entry log4j.logger.org.wso2.carbon.user.core=DEBUG [IS_Home] /repository/conf/log4j.properties添加以下条目log4j.logger.org.wso2.carbon.user.core = DEBUG

This will give the debug logs which will help to understand the issue 这将提供调试日志,这将有助于理解问题。

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

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