我首先使用移动设备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',{});
}