Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ibm mobilefirst IBM MobileFirst V8.0:更新活动用户_Ibm Mobilefirst_Mobilefirst Adapters - Fatal编程技术网

Ibm mobilefirst IBM MobileFirst V8.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

我正在使用MobileFirst Platform V8.0,成功登录后需要更新活动用户属性。是否有任何解决方案可以在不注销的情况下更新活动用户。

设置活动用户无需注销&用户通过API setActiveUser身份验证后,您可以立即在适配器中设置活动用户

可以找到有关setActiveUser和getActiveUser API的详细信息

下面的代码是关于如何在adapter for Mobilefirst 8.0注册中执行此操作的示例

欲了解更多信息,请浏览

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