Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5760 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted (edited)

//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

This topic is 5760 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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