WSO2自我注册确认电子邮件

时间:2014-11-12 17:07:05

标签: wso2 wso2is

我有一个客户端使用UserInformationRecoveryServiceStub来注册新用户。这有效,直到我配置WSO2 IS发送确认电子邮件。

在identity-mgt.properties中我设置了

Identity.Listener.Enable=true
Notification.Sending.Internally.Managed=true
Authentication.Policy.Account.Lock.On.Creation=true
Notification.Expire.Time=7200
Notification.Sending.Enable=true 
Authentication.Policy.Enable=true 

现在,当客户端调用UserInformationRecoveryServiceStub.registerUser()时,用户将被添加到用户存储中,但不会发送电子邮件,并且客户端会收到以下异常:

SEVERE: null
org.wso2.carbon.identity.mgt.stub.UserInformationRecoveryServiceIdentityMgtServiceExceptionE(uxception: UserInformationRecoveryServiceIdentityMgtServiceExceptionException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at java.lang.Class.newInstance(Class.java:433)
at org.wso2.carbon.identity.mgt.stub.UserInformationRecoveryServiceStub.registerUser(UserInformationRecoveryServiceStub.java:685)
at com.ijet.wso2is.client.UserInformationRecoveryServiceClient.registerBjnUser(UserInformationRecoveryServiceClient.java:191)
at com.ijet.wso2is.client.UserInformationRecoveryServiceClient.main(UserInformationRecoveryServiceClient.java:69)

以下是您感兴趣的客户代码。

UserIdentityClaimDTO claim = new UserIdentityClaimDTO();
    claim.setClaimUri("http://wso2.org/claims/emailaddress");
    claim.setClaimValue("testee@xyz.com");
    claimList.add(claim);

    claim = new UserIdentityClaimDTO();
    claim.setClaimUri("http://wso2.org/claims/givenname");
    claim.setClaimValue("Testee");
    claimList.add(claim);

    claim = new UserIdentityClaimDTO();
    claim.setClaimUri("http://wso2.org/claims/lastname");
    claim.setClaimValue("Tester");
    claimList.add(claim);

    serviceStub.registerUser(TEST_USERNAME, 
            "Password#1", 
            claimList.toArray(new UserIdentityClaimDTO[claimList.size()]), 
            null, 
            null);

1 个答案:

答案 0 :(得分:0)

你在使用IS 5.0.0吗?我仔细检查了代码,似乎发送了电子邮件。简单地评论它是行不通的。 但是,如果您在未指定密码的情况下注册用户,它对我有用。在该用例中,服务器运行通过发送电子邮件的不同代码部分。

相关问题