IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  create cookie when user login

    Posted 02/20/13 01:24 AM

    i need crete cookie when user login in portal

    i’m use a “event handle”
    event type = login
    listener type= synchronous

    
    HttpServletRequest request = PortalServlet.getCurrentRequest();  
    MWSLoginEvent event = (MWSLoginEvent)getEvent();
    
    Action action = event.getAction();
    if (action == MWSLoginEvent.Action.ACTION_LOGIN_SCRIPT_DONE) {
    
    Cookie cookie = null;
    Cookie[] cookies = request.getCookies();
    
    if (cookies != null){
    for (int i = 0; i < cookies.length; i++){
    if (cookies[i].getName().equals("CookieSession")){
    cookie = cookies[i];
    } 
    }
    }
    
    if (cookie == null){
    cookie= new Cookie ("CookieSession","aaaa");
    response.addCookie(cookie) ;
    }      
    } 

    but resquest and response are null. PortalServlet.getCurrentRequest() not work for me…


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 2.  RE: create cookie when user login

    Posted 02/20/13 03:18 AM

    Event handlers do not run in the context of the HTTP request, so your request object will always be null in this case.

    Perhaps you could create the cookie using a custom auth handler or using a portlet on a custom start page.


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 3.  RE: create cookie when user login

    Posted 02/20/13 02:51 PM

    How I can create a custom auth handler?


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods