将Mobilefirst CLI 7.1与ldap集成时遇到问题

时间:2015-12-23 13:13:28

标签: authentication ldap ibm-mobilefirst mobilefirst-server mobilefirst-cli

我首先使用移动设备CLI 7.1并尝试与LDAP集成。

我正在关注this文件的实施。在浏览器中首次加载应用程序时,我收到401错误(Failed to load resource: the server responded with a status of 401 (Unauthorized))。我尝试登录时收到500错误(POST http://localhost:10080/Project/apps/services/j_security_check 500 (Internal Server Error))。我已经取消注释wl.client.connect并在stackoverflow中完成了以下对话。 Link1link2link3

服务器日志

 [ERROR   ] SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:BasicRegistry/admin.
 [ERROR   ] SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:BasicRegistry/admin.
 [ERROR   ] SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:BasicRegistry/admin.
 [ERROR   ] SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:BasicRegistry/admin.

我的情景是什么?

用户最初被带到登录页面,之后当他点击登录时我将收集详细信息并在提出挑战并提交时自动设置为j_secutity_form。当我打开应用程序时,我得到401,当我点击登录时获得500。哪个叫

var reqURL = '/j_security_check';
        var options = {};
        options.parameters = {
            j_username : loginData.email,
            j_password : loginData.password
        };
        options.headers = {};
        ldapRealmChallengeHandler.submitLoginForm(reqURL, options,ldapRealmChallengeHandler.submitLoginFormCallback);   

我有以下问题:

1)我所关注的文档是完整的还是需要添加一些需要做的事情?

2)被上述错误阻止的原因是什么

这是我的代码:

var ldapRealmChallengeHandler = WL.Client.createChallengeHandler("LDAPRealm");

ldapRealmChallengeHandler.isCustomResponse = function(response) {
    if (!response || response.responseText === null) {
        return false;
    }
    var indicatorIdx = response.responseText.search('j_security_check');

    if (indicatorIdx >= 0){
        return true;
    }  
    return false;
};


ldapRealmChallengeHandler.handleChallenge = function(response){
};

ldapRealmChallengeHandler.submitLoginFormCallback = function(response) {
    var isLoginFormResponse = ldapRealmChallengeHandler.isCustomResponse(response);
    if (isLoginFormResponse){
        ldapRealmChallengeHandler.handleChallenge(response);
    } 
    else {
        ldapRealmChallengeHandler.submitSuccess();
    }
};  

logout = function(){
    WL.Client.logout('LDAPRealm',{});
}

1 个答案:

答案 0 :(得分:0)

我认为这可能与会话独立模式有关,默认情况下从MFP 7.1开启。我想这可以解释为什么你得到SESN0008E错误。 Here是指向如何禁用会话独立性的文章的链接。

有关SESN0008E错误here的更多信息。

请告诉我你是怎么过的。