2016-05-05 29 views
2

在我们当前的WSO2设置中,用户执行自我创建后,我们将他的帐户置于锁定状态,并向创建期间指定的地址发送确认电子邮件。此电子邮件有一个允许用户验证其帐户的链接。WSO2发送恢复通知

出于开发目的,我们正试图使用​​SOAP UI中的UserInformationRecoveryService wsdl来降低工作流程。我们似乎想要的服务被称为sendRecoveryNotification。下面是该服务的签名:

sendRecoveryNotification(String username, String key, String notificationType) 

username参数仅仅是WSO2用户的问题,这对我们的用户名。对于notificationType,我们一直在使用email,这可能会触发电子邮件发送给用户。问题出在key参数。目前还不清楚应该用什么值key,和我们所有的猜测总是导致这种错误响应:

用户

18001无效验证码:tbiegeleisen @ abc.com @ tenant.com

我们也注意到其他几个服务也期望有一个关键字,但不清楚如何获得这个值。

有人可以阐明WSO2中用户恢复的工作流程吗?它似乎是一个Catch-22,它需要一个令牌来生成一个发送给用户的新令牌。

回答

1

WSO2 documentation明确说明了使用通知进行恢复的工作流程。需要使用的key是呼叫到verifyUser() SOAP Web服务的返回值。该服务本身预计通常会从UI发送的验证码。以下是显示恢复通知如何发送的代码片段:

String cookies = client.login("[email protected]@tenant.com", "admin"); 
UserInformationRecoveryUtil userInfoutil = new UserInformationRecoveryUtil(webserviceUrl, cookies); 
CaptchaInfoBean captchaInfo = new CaptchaInfoBean(); 
captchaInfo.setImagePath(captchaPath); 
captchaInfo.setSecretKey(captchaKey); 
captchaInfo.setUserAnswer(captcha); 
String username = emailId + "@" + tenantDomain; 
String key = userInfoutil.verifyUser(username, captchaInfo); 

// now pass the key based on the Captcha along with the type of recovery action 
userInfoutil.sendRecoveryNotification(username, key, "accountUnLock");