Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

External Auth. in PHP CWP

Featured Replies

Hello,

I have read that external authentication can be used in conjunction with the PHP API. When testing this out, however, I get some unexpected results - if I enter the wrong credentials in the HTML form that sends the UN/PW to my login script, I would expect to get a FileMaker_Error object back when trying to instantiate my FileMaker connection object. However, my call to FileMaker::isError($fm) does not evaluate to TRUE, so it would seem that the bogus credentials allowed me into the file.

Anybody know what's going on here? How can I tell if the authentication is/isn't working?

Thanks,

Jeff

... you should probably post your code.

  • Author

Sorry, I thought it was generic enough to not need a code example.


$fm = new FileMaker('dbName', NULL, $un, $pw);

//Open file 'dbName' from localhost with UN/PW values extracted from $_POST



if (FileMaker::isError($fm))

{

   echo "ERROR!!!"

}

else

.

.

.





I have since discovered (posting this for anyone else who encounters this behavior and is confused by it) that the FileMaker PHP API will not return an error object if the credentials are incorrect.  It doesn't let you know that until you try doing something with the database.



Ie., the result assigned to $fm will not be an error object.  If you then continued on and did something such as:





$list = $fm->listLayouts();

... THEN you get a FileMaker_Error object as a return.

Hmmm, yeh that slipped my mind.. now i remember why i put a false command into my connection files :

Anyway it's expected operation: you only get a result or error object once you execute a command.

//Open file 'dbName' from localhost with UN/PW values extracted from $_POST

This isn't correct, the constructor for the Filemaker object just sets the variables it receives. It doesn't send a request to the XML feed so it won't know if the values are correct, hence it doesn't throw an error.

Edited to add:

The Filemaker PHP API library does not create a connection handle along the lines of the PEAR Database libraries. It simply sends requests via cURL to the XML feed and parses the results.

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.