我正在使用移动优先 CLI 7.1 并尝试与 LDAP 集成。
我正在按照这个文件来实施。Failed to load resource: the server responded with a status of 401 (Unauthorized)
第一次在浏览器中加载应用程序时出现 401 错误 ( )。我在POST http://localhost:10080/Project/apps/services/j_security_check 500 (Internal Server Error)
尝试登录时收到 500 错误()。我取消了 wl.client.connect 的注释,并在 stackoverflow 上完成了以下对话。链接1 、链接2和链接 3
服务器日志
[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',{});
}