0

I am using mobile first CLI 7.1 and trying to integrate with the LDAP.

I am following this document to implement. I am getting 401 error (Failed to load resource: the server responded with a status of 401 (Unauthorized)) when loading the application for first time in the browser. I am getting 500 error(POST http://localhost:10080/Project/apps/services/j_security_check 500 (Internal Server Error)) when I try to logging in. I have uncommented wl.client.connect and gone through the following conversations at stackoverflow. Link1, link2 and link3

Server Logs

 [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.

What is my scenario?

User is initially taken to login page and later when he clicks on login I will collect the details and automatically set to j_secutity_form when it throws challenge and submit. I am getting 401 when I open the application and getting 500 when I click on login. which calls

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

I have following questions:

1) Is the documentation that I am following is complete or it needs some additions thing that need to be done ?

2) What is the cause for getting blocked with the above errors

And here is my code:

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',{});
}
Community
  • 1
  • 1

1 Answers1

0

I think this might be related to session independence mode which is turned ON by default as of MFP 7.1. I think this might explain why you are getting the SESN0008E error. Here is a link to an article that explains how to disable session independence.

There is more information on the SESN0008E error here.

Please let me know how you get on.

Andrew Ferrier
  • 16,664
  • 13
  • 47
  • 76