Please do not mind I figured out How to do it.

Its simple. Just use URLLoader, URLRequest, URLVariables Classes and
emulate what HTML form does. here is the code
var urlVar:URLVariables;
        var urlReq:URLRequest;
        
        urlVar = new URLVariables();
        urlVar.j_username = "CEO";
        urlVar.j_password = "raja1248";
        urlVar._j_spring_security_remember_me = "false";
        
        urlReq = new 
URLRequest("http://dell-15rse:8080/Tej-EIS/j_spring_security_check";);
        urlReq.method = "POST";
        urlReq.data = urlVar;

        var loader:URLLoader = new URLLoader();

        loader.addEventListener(Event.COMPLETE, completeHandler);
        loader.addEventListener(Event.OPEN, openHandler);
//                              loader.addEventListener(ProgressEvent.PROGRESS, 
progressHandler);
        loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, 
securityErrorHandler);
        loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
//                              loader.addEventListener(IOErrorEvent.IO_ERROR, 
ioErrorHandler);

        
        try {
                loader.load(urlReq);
        }
        catch(error:Error) { 
                trace("Unable to load requested document.");
        }                               

completeHandler receives whatever page mentioned for login success/login 
failure in form-login element of spring security 
config. On login success, subsequent requests to secured 
resources are possible  by default nothing special is to be done.

I am now trying to explore possibility of raising exception 
in case of login failure so that I can use HTTPService and its 
result and fault events by spring security config modifications.

Hope this helps to someone who fumbles on AIR login issue.

Thanks and warm regards

Raja Patil
 





Reply via email to