Hi All: I've recently been looking at tightening security on my sql-backended webs. One of the things I started rolling back were permissions on the sql account used in web.config to connect to the database. Where in the past I just automatically assigned the sql login "dbo" role, I've started restricting the login to "db_datareader" and "db_datawriter" roles, in the hope that this would prevent a hacker from using sql injection to return object names and the like.
I just ran into a problem, however, with a database that uses a lot of SProcs...if the sql login only has datareader/datawriter privs, executing the SProc in code-behind throws an error:
The EXECUTE permission was denied on the object 'mySP', database 'myDB', schema 'dbo'.
I found on MSDN the instructions to modify the SProcs with "With Execute As Owner"...I updated the procedures with that line, confirmed it was there, but I'm still getting the error message above...where am I going wrong?