8 Replies Latest reply on Apr 17, 2013 7:34 AM by carlsson

    Send field content from FM to WebViewer

    carlsson

      I have stored username and password in a Filemaker file. Now I want to pass along these values to the following page:

       

      "http://pad.find.eu/manage"

       

      However, I can't get it to work.

       

      Something like this?

      "http://pad.find.eu/manage?" & "email=xxx,password=yyy"

       

      Thanks,

      /andreas

        • 1. Re: Send field content from FM to WebViewer
          mikebeargie

          If you've stored the username and password in a users table in the file, the calculation would be:

           

          "http://pad.find.eu/manage?email=" & table::username & ",password=" & table::password

           

          If you've stored the username and password as global variables as part of a login script, the calculation would be:

           

          "http://pad.find.eu/manage?email=" & $$username & ",password=" & $$password

           

          There is no way (for security purposes) to return the password of a currently logged in user if you are using the standard filemaker username and password (file > manage > security) login system. You can return account name using Get(AccountName) though.

           

          Can you provide more details as to how you have "stored" the username and password you refer to?

          • 2. Re: Send field content from FM to WebViewer
            carlsson

            Thanks for the answer Mike!

            However it doesn't work. You gave the same URL as in my example in my post, was that intentional?

             

            The solution:

            Our client have a Filemaker solution with companies that have bought advertisement locations.

            Every company are given a login to a website to see what they have bought. This website have nothing to do with Filemaker. It's located at pad.find.eu/manage.

            We store the company information in a Filemaker database, together with their login name and password (to the find.eu page mentioned above).

            With a webviewer we are perfectly able to see pad.find.eu/manage. But, I also want to pass along the name and password.

             

            The problem, as I see it as a web noob, is that that login page is built with Java (I think) and it may be hard to pass along parameters from FM?

            I am also not sure if the parameters are correct, I looked at it with the Developer menu in Safari.

            I may be totally wrong since Web development isn't my greatest strength...

            • 3. Re: Send field content from FM to WebViewer
              mikebeargie

              I was only using your link as an example. But my solution above outlines a need for a more robust filemaker and web component to handle what you are trying to do.

               

              Basically in filemaker, you need to set up a users/password table, and store that data in a filemaker table.

               

              You then need to calculate a link to the web that passes a user and pass value from that filemaker table into the webviewer (unfortunately will be done in plaintext)

               

              Then whatever web script that is handling the link in the webviewer, will be required to parse the link, garnering the username and password from the link, and performing the login action automatically (without user interaction).

               

              If you were to use a plugin, such as 360works scriptmaster, you might be able to run the java to perform the login on filemaker's side, but I'm not familiar with how scriptmaster interfaces with the webviewer.

              • 4. Re: Send field content from FM to WebViewer
                steve_ssh

                Hello Andreas,

                 

                Try starting with:

                 

                   "http://pad.find.eu/manage?email=" & GetAsURLEncoded ( $varEmail ) & "&pass=" & GetAsURLEncoded ( $varPassword )

                 

                 

                Where:

                 

                   $varEmail  has been set to the Email value used for login

                 

                  - and -

                 

                  $varPassword  has been set to the Password value used for login

                 

                 

                This may or may not work, depending on whether the server-side at  http://pad.find.eu/manage  allows for login via a GET method ( contacting the server using just a URL ) instead of a POST method ( the method used by default via their web form ).

                 

                Also, please note that even if it does work, it has the potential to break, should the server-side of http://pad.find.eu/manage ever change.  The safest thing to do would be to contact whomever maintains http://pad.find.eu/manage, and ask them if they have some sort of established login API that you can rely on.

                 

                Hope this helps,

                 

                -steve

                • 5. Re: Send field content from FM to WebViewer
                  mikebeargie

                  This is what I meant by having your web script "parsing" the link you create out of filemaker.

                   

                  To elaborate a bit on it as well, if you wanted to make the password secure while passing it to the link, you will need something in filemaker that hashes your filemaker-stored password, and decrypts it on the web side.

                   

                  It's simpler to just pass and parse the password as plain text through the link, but that is far less secure.

                   

                  There's a free plugin for filemaker that does all sorts of hashing if you want to get into that:

                  http://www.dracoventions.com/products/2empowerFM/family/regex.php

                  steve_ssh wrote:

                   

                  This may or may not work, depending on whether the server-side at  http://pad.find.eu/manage  allows for login via a GET method ( contacting the server using just a URL ) instead of a POST method ( the method used by default via their web form ).

                  • 6. Re: Send field content from FM to WebViewer
                    carlsson

                    Thanks for the answers guys!

                    It seems that I need an API or mentioned plugin.

                     

                    I thought there was a way with the Web Viewer to input content to a field, no matter how the field was presented...

                     

                     

                    (as mentioned, I'm not very skilled with Web solutions )

                    • 7. Re: Send field content from FM to WebViewer
                      mikebeargie

                      I'd like to reiterate that you don't need an API or plugin. You can accomplish what you want to do, but it requires a web developer to setup a web side file that handles GET to pull variables from a URL passed from filemaker, through the web viewer, and processes the login accordingly.

                       

                      The plugin I mentioned is for hashing, which you could add later after doing your proof-of-concept with a plain text URL user/pass

                       

                      Anyways, best of luck. I've dealt with similar things before and it's not the easiest thing to put together.

                      • 8. Re: Send field content from FM to WebViewer
                        carlsson

                        Understood.

                         

                        The web developer did some changes, so now it *is* possible to send the user and password with the URL. Great!

                         

                        Thanks for all the help!