AnsweredAssumed Answered

WebDirect Login Form / SSO

Question asked by martya on May 12, 2014

Title

WebDirect Login Form / SSO

Your post

     Hi,
      
     We use SSO system to auto-login user on IWP of FileMaker Server 12. 
     => This system fills in HTML input fields (username and password) of login form with user's informations.
      
     But in FileMaker 13 the login form of WebDirect don't have "ID" or "Name" HTML attributes, so the SSO system is not able to submit correctly the form.
      
     I find this solution : I modify this file 
      
     %SYSTEM%\FileMaker\FileMaker Server\Web Publishing\publishing-engine\jwpc-tomcat\fmi\VAADIN\widgetsets\com.filemaker.jwpc.iwp.widgetset.UIWidgetSetcom.filemaker.jwpc.iwp.widgetset.UIWidgetSet.nocache.js
      
     This file is used by the logon page, so I add this code at the end
      
     // Get URL Paramter by Name
     function getURLParameter(name) {
     return decodeURI(
     (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, null])[1]
     );
     }
      
     // Check if not exist url parameter 'mode'
         if (getURLParameter('mode') == 'null') {
        // Execute every 100 millisecondes function
     var docLoaded = setInterval(function () {
     // Check if exist html input
     if (typeof document.getElementsByTagName("input")[2] != "undefined" && typeof document.getElementsByTagName("input")[3] != "undefined") {
      
     // If Exist stop iteration
     clearInterval(docLoaded);
      
     // Add attribute ID and Name to username html input field
     document.getElementsByTagName("input")[2].setAttribute('id' , 'username');
     document.getElementsByTagName("input")[2].setAttribute('name' , 'username');
      
     // Add attribute ID and Name to password html input field
     document.getElementsByTagName("input")[3].setAttribute('id' , 'password');
     document.getElementsByTagName("input")[3].setAttribute('name' , 'password');
     }
     }, 100);
     }
     //
      
     I want to know if exist a better way? 
      
     Thank you for your reply

Outcomes