【问题标题】:WSO2 Send Recovery NotificationWSO2 发送恢复通知
【发布时间】:2016-05-05 09:50:07
【问题描述】:

在我们当前的 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。

【问题讨论】:

    标签: authentication wso2 soapui


    【解决方案1】:

    WSO2 documentation 清楚地说明了带有通知的恢复工作流程。需要使用的key 是调用verifyUser() SOAP Web 服务的返回值。该服务本身需要一个验证码,该验证码通常会从 UI 发送。这是一个代码 sn-p 显示如何发送恢复通知:

    String cookies = client.login("admin@tenant.com@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");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-30
      • 1970-01-01
      • 1970-01-01
      • 2016-12-06
      相关资源
      最近更新 更多