【发布时间】:2015-12-23 13:13:27
【问题描述】:
我正在使用移动优先 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 上进行了以下对话。 Link1、link2 和 link3
服务器日志
[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',{});
}
【问题讨论】:
标签: authentication ldap ibm-mobilefirst mobilefirst-server mobilefirst-cli