Kirsten said:
I'm trying to implement custom authentication in ASP.NET and then use this
user for making the sql connection (SQL Authentication, not Integrated
security).
When the user logins, I have the sql_username and sql_password stored in
the Session variable.
My question are:
- When should I set the connection string?
- What about connection pooling?
Back up a second. I have read most of the thread and I think you are asking
one thing and wanting something a bit bigger.
The first thing I would suggest is looking up creating a custom Membership
Provider to fit your schema. It is much less taxing than creating some type
of completely custom authentication method along with the plumbing that goes
along with it. Here is a good starting point:
http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx
There is really no reason to code all the plumbing yourself.
As for the auditing question, you might be better implementing your own
auditing. One way to do this is to set triggers on the audited tables and
put the table name, ID and user information, using the user's GUID (or other
id data type, if you customize this). This will give you row level auditing
on the table, if that is your primary need. You can pass the user's guid to
insert in the table having a "last edited" field and last edited date. The
auditing table will have any other information you need.
In addition, there is no real need to keep the user's id in session, as the
server cookie will hold enough info for you to grab this information.
In general, I would not mess with the connection pooling unless you find you
need to. The default offers you plenty in most applications. Only alter if
you find there are problems.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
********************************************************
| Think outside the box! |
********************************************************