SQLTeam.com | Weblogs | Forums

Authenticating Users...? Linking user accounts with a table?


#1

Afternoon all,

I'm having a play around with Laravel & writing a Web API at the moment, linking Laravel (PHP) to SQL Server 2008 is relitively easy, the thing I don't understand is the authentication...

Currently have a table called Users & the Users table contains ID, Username, Password & Token.

Problem is I want to be able to run SQL queries using the SQL Username & Password & at them moment I'm a little confused how I can link the two together...

I'll try and explain, SQL Server has 4 user accounts with passwords SA, Laravel, Bob & John.
'SA', obvious, 'Laravel' is the account Laravel uses to read & write data, Bob & John are basic user accounts used for the respective users to read and write data... The 'Users' table also contains Bob & John that Laravel uses to authenticate its users. Problem is even tho the users authenticate through the API, when they read or (more importantly) write data via the API SQL Server see it as being read or written by the 'Laravel' user account....

hope that makes sense....

Thanks

Dave