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.  Obtaining logined user information

    Posted 04/11/13 05:30 AM

    Hi All!
    A little OPPORTUNITY here. I have created a portlet application, which pushes data into MSSQL table via standart WSDL. Also I have managed bean in which i would like to store username and id of logined user in order to insert them in the table. How can I get current logined user to proceed him in my portle data operations?


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


  • 2.  RE: Obtaining logined user information

    Posted 04/11/13 07:13 PM

    If you just want the username, you can use the standard technique for getting the remote username

    For example:

    getFacesContext().getExternalContext().getRemoteUser() 

    Or if you need more details about the current user, you can use the MWS CDS apis.

    For example:

    
    IDirectorySession s = null; 
    try {
    //start a directory session
    s = DirectorySystemFactory.getDirectorySystem().createSession();
    
    //lookup the info about the current user
    IDirectoryPrincipal principal = s.lookupPrincipalByID(IDirectorySession.CURRENT_USER);
    
    String name = principal.getName();
    //etc..
    
    } finally {
    //done, so release the directory session
    if (s != null) {
    DirectorySystemFactory.getDirectorySystem().destroySession(s);
    }
    }
    

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