Ibm mobilefirst IBM MobileFirst V8.0:更新活动用户
我正在使用MobileFirst Platform V8.0,成功登录后需要更新活动用户属性。是否有任何解决方案可以在不注销的情况下更新活动用户。设置活动用户无需注销&用户通过API setActiveUser身份验证后,您可以立即在适配器中设置活动用户 可以找到有关setActiveUser和getActiveUser API的详细信息 下面的代码是关于如何在adapter for Mobilefirst 8.0注册中执行此操作的示例 欲了解更多信息,请浏览Ibm mobilefirst IBM MobileFirst V8.0:更新活动用户,ibm-mobilefirst,mobilefirst-adapters,Ibm Mobilefirst,Mobilefirst Adapters,我正在使用MobileFirst Platform V8.0,成功登录后需要更新活动用户属性。是否有任何解决方案可以在不注销的情况下更新活动用户。设置活动用户无需注销&用户通过API setActiveUser身份验证后,您可以立即在适配器中设置活动用户 可以找到有关setActiveUser和getActiveUser API的详细信息 下面的代码是关于如何在adapter for Mobilefirst 8.0注册中执行此操作的示例 欲了解更多信息,请浏览 public void autho
public void authorize(Set<String> scope, Map<String, Object> credentials, HttpServletRequest request, AuthorizationResponse response) {
PersistentAttributes attributes = registrationContext.getRegisteredProtectedAttributes();
if (attributes.get("pinCode") != null){
// Is there a user currently active?
if (!userLogin.isLoggedIn()){
// If not, set one here.
authorizationContext.setActiveUser(userLogin.getRegisteredUser());
}
setState(SUCCESS_STATE);
response.addSuccess(scope, getExpiresAt(), this.getName());
} else {
setState(STATE_EXPIRED);
Map <String, Object> failure = new HashMap<String, Object>();
failure.put("failure", "User is not enrolled");
response.addFailure(getName(), failure);
}
}