User Authentication - Error on Login

Archived from the Xataface Users forum.

00Davo — Tue Feb 02, 2010 7:30 pm

When trying to use the login box for authentication, I get this error:

Code: Select all
Fatal error: Uncaught exception 'Exception' with message '2' in C:\xampp\xampp\htdocs\newypt\xataface\Dataface\Serializer.php:68 Stack trace: #0 C:\xampp\xampp\htdocs\newypt\xataface\Dataface\AuthenticationTool.php(139): Dataface_Serializer->serialize('username', 'bob') #1 C:\xampp\xampp\htdocs\newypt\xataface\Dataface\AuthenticationTool.php(210): Dataface_AuthenticationTool->checkCredentials() #2 C:\xampp\xampp\htdocs\newypt\xataface\Dataface\Application.php(1534): Dataface_AuthenticationTool->authenticate() #3 C:\xampp\xampp\htdocs\newypt\index.php(19): Dataface_Application->display() #4 {main} thrown in C:\xampp\xampp\htdocs\newypt\xataface\Dataface\Serializer.php on line 68

This occurs no matter what I have actually typed into the Username and Password boxes - the same error every time.

– Necessary helpful files –
Here’s conf.ini:

Code: Select all
`[_database]
    host = localhost
   name = ypt
   user = ypt
   password = ypt

[_tables]
   dashboard = Foyer
   student = Students
   waitinglist = Waiting Lists
   attendance = Attendance
   class = Classes
   adult = Adults
   meeting = Meetings
   production = Productions
   users = Users

[_auth]
     users_table = users
     username_column = “username”
     password_column = “password”
    allow_register = 1
   
[history]
   enabled = 1`

And here’s /tables/users/fields.ini:

Code: Select all
`[UserID]
   visibility:list = hidden

[Password]
    encryption = md5`

Table definition for Users:

Code: Select all
CREATE TABLE `users` (                                                              `UserID` int(11) NOT NULL AUTO_INCREMENT,                                        `UserName` varchar(32) NOT NULL,                                                  `Password` varchar(32) NOT NULL,                                                  `Role` enum('READ ONLY','EDIT','DELETE','ADMIN') DEFAULT 'READ ONLY',            PRIMARY KEY (`UserID`)                                                          ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

I have not yet configured any custom permissions as delegate classes. I’ll leave that part until after I can get this issue solved.

EDIT: Also, registrations do not correctly function. No errors show up, but the new user isn’t actually added to the table.


shannah — Thu Feb 04, 2010 12:09 pm

There it is. Xataface is case sensitive. In your [_auth] section you have:

Code: Select all
username_column = "username" password_column = "password"

But your table definition shows that your username and password columns are actually named:

Code: Select all
`UserName` varchar(32) NOT NULL,                                        `Password` varchar(32) NOT NULL,

i.e. case is not the same.

-Steve


00Davo — Fri Feb 05, 2010 12:47 am

shannah wrote:There it is. Xataface is case sensitive.

Oops. You’ve told me that before. I should have remembered.

It works beautifully now. Thanks again.