0

I’m writing an CI application that has to have authentication and preferably different roles (normal and administrator). I’ve used the awesome tank_auth library when using a MySQL DB and I’ve never had any problems. I’m getting issues using it with SQL SERVER. Weird things like telling me the username is taken when the users table is empty, and when I do insert a user (after removing username checking) when I log in I’m constantly getting incorrect creds errors even though I’m 100% sure that the details are correct.

Is anyone successfully using any good authentication libraries with a SQL SERVER DB? Or even better has anyone managed to get tank_auth working with SQL SERVER?

I’m using the sqlsrv driver btw.

Any help wold be most appreciated!

Billy

ION_AUTH Error

A Database Error Occurred

Error Number: 22003

[Microsoft][SQL Server Native Client 10.0][SQL Server]Arithmetic overflow error converting expression to data type datetime.

INSERT INTO users (username, password, email, group_id, ip_address, created_on, last_login, active) VALUES ('billy jones', '0c85ef6874f2e08d3667a4334c4f4fc0d95b9358', '[email protected]', 2, '127.0.0.1', 1297081373, 1297081373, 1)

Filename: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\cp\system\database\DB_driver.php

Line Number: 330

4 Answers 4

3

Tried Ion Auth? Works fine with MSSQL and a bunch of other DB engines.

Sign up to request clarification or add additional context in comments.

4 Comments

Well it looks good but I'm getting an error. I've created the schema, I can see the default user in the users table but when I use [email protected] and 'password' I get an 'In-Correct Login' error :(
Passwords are salted using the encyption_key in config, if that has changed then that password will be encrypted with a different salt to the one in the DB. Try registering a user and changing them to admin.
Hi Phil, I've tried to register a new user but I'm getting an arithmatic overflow error on a date field. I've added the error to my question if you could have a look, thanks
Looks like unix timestamps are trying to go into a datetime field. I know nothing of MSSQL so I'll let you fix this one, but it should be nice and easy. Don't forget the pull request when you are done!
1

This is another secure authentication library, with lot's of security features: http://ulogin.sourceforge.net/

1 Comment

Please don't post just a link; links tend to disappear but questions do not. We want the answer to be here for future people stumbling across the question.
0

What about Zend_Auth with Zend_Acl. Zend Framework is a loosely coupled library so you can just use these two classes separately.

Zend_Auth for authentication and Zend_Acl for user roles and permissions.

Comments

0

Write your own!

Or if you don't want to waste hours of learning security and advanced sql go to the CI contribution section in the wiki: http://codeigniter.com/wiki/Category:Contributions::Libraries::Authentication/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.