• Combine Dojo Login with Sametime Login

    By T Theurer 1 decade ago

    I would like to combine/expand the Dojo Login Custom Control with the Xpages Control for Lotus Sametime, but unfortunately I am not able to transfer the username and the password from the Login Custom Control Dialog into a sessionScope variable, that I need for the stConfig Custom Control. (I cannot use the LPTA token, because the sametime server is sitting in another domain.)

    Any help/ideas are highly appreciated.

    Thomas

    • I have experience with that. Two options

      By F. Kranenburg 1 decade ago

      Thomas,

      To put the name and password inside sessionScope variables, you will have two options. I had both options working. The first option is to create a custom event handler and give it an id. You can put serverside code inside it and read parameters. You could find more info about this technique here : http://xpages.info/XPagesHome.nsf/Entry.xsp?documentId=88065536729EA065852578CB0066ADEC

      The second option is de most easiest way. Use the Extension Library and use the JSONrpcservice component. This component let's you create a client side function including parameters and fire serverside script afterwards. At supports a callback, so you can easely add it to login() script. Call the service including the two parameters and after the service is done you will be able to use that control. More information about this service can be found here http://www-10.lotus.com/ldd/ddwiki.nsf/dx/The_JSON_RPC_Service.

      I had the same question from several others but I need the time to put an example together. If you need more info or help, please ask!

      Ferry Kranenburg

      • JSON do the trick

        By T Theurer 1 decade ago

        Great,

        it works fine with JSON. Even if it took me an hour (or so) to find out that the argument-names could just be used as they are. Sometimes its so simple :-))

        thx again

        Thomas

         

         

        • Here is the solution

          By T Theurer 1 decade ago

          I would like to share the solution.

          Ive added the jsonRpcService to the main xPage:

           
            
             
              
               
               
              

                    sessionScope.put("stLoginPW", stPW)]]>
              

             

            

           

          and add the call into the DojoLogin Custum Control

           ....   
                  if ( dojo.cookie('DomAuthSessId') != null || dojo.cookie('LtpaToken') != null ) {

           // Set Login parameter für Sametime
                  var deferred = setLoginArgs.set(dojo.byId('#{id:username}').value,dojo.byId('#{id:password}').value)
                  deferred.addCallback(function(result) {})

                         // we are logged in, but do we have access to the next url?
           ...

          That's it

          Thomas