简体   繁体   中英

WSO2 User self registration

I am trying to call the WSO2 Identity server web service using a java client.

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:

Password pattern policy violated. Password should contain a digit[0-9], a lower case letter[az], an upper case letter[AZ], one of !@#$%&* characters

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

Nothing in WSO2 log and the user is not added. 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

This will give the debug logs which will help to understand the issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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