简体   繁体   English

WSO2自我注册确认电子邮件

[英]WSO2 Self Registration Confirmation Email

I have a client using the UserInformationRecoveryServiceStub to register new users. 我有一个使用UserInformationRecoveryServiceStub的客户端注册新用户。 This works until I configure WSO2 IS to send a confirmation email. 在我配置WSO2 IS发送确认电子邮件之前,此方法一直有效。

in identity-mgt.properties I set: 在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 

Now when the client call UserInformationRecoveryServiceStub.registerUser(), the user is added to the user store but no email is sent and the client receives the following exception: 现在,当客户端调用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)

The following is the client code of interest. 以下是感兴趣的客户端代码。

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);

Are you working on IS 5.0.0? 您正在使用IS 5.0.0吗? I went through the code and it seems that the sending of emails is commented out. 我遍历了代码,似乎电子邮件发送已被注释掉。 Simply commenting it in didn't work. 简单地在中发表评论是行不通的。 But it worked for me, if you register the user without specifying a password. 但这对我有用,如果您在不指定密码的情况下注册用户。 In that use case the server runs through a different part of code which really sends out emails. 在这种用例中,服务器运行代码的不同部分,该部分实际上发出电子邮件。

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

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