Forms based authentication provider

K

karlman

Is there a way to make a SQL 2005 server the provider for the user and
roles database for form based authentication?

Maybe I am going about this the wrong way?

I want to have more control over the process so I figure it would be
easier if everything was in the same database. I want to be able to
extend the database with additional user information.

Here is how I would imagine this to go:

1. An admin person gets a new hire request.
2. The admin goes to a page and creates a new user and assigns roles.
3. An email is sent to the new user with login info.
4. The new user logs in.
5. New user must change password and set security question.
6. New user ready for use.

Alternatively I could have the new user create their own account. I
would then need the admin to be able to come in later and assign
roles.

I see that I can access a lot of this info through security objects
but what is the best way to relate user identity into my many other
tables when the user table is in another database?

Thank
Karl
 
M

Muhammad Naveed Yaseen

I would have avoided implementing custom membership and role provider
by myself because there already exist standard providers for Sql
Server. Custom membership and role providers are probably more than a
week job in order to do it properly (I have done it once for MySql).

If all you want is to have user's membership and role information
stored in the same Sql Server database as data, you can easily
configure database of your choice to have membership and role tables
by running aspnet_regsql (usually in C:\windows\Microsoft.NET\Framework
\vx.x.x.x) from windows explorer (because windows mode has easier
GUI).


After running aspnet_regsql for explicitly chosen database, you would
also need entries like following in web.config

<membership defaultProvider="ABCAspNetSqlMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="ABCAspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ABCConnectionString"
applicationName="ABC"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
passwordFormat="Hashed"
passwordStrengthRegularExpression=""
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
/>
</providers>
</membership>
<roleManager enabled="true"
defaultProvider="ABCAspNetSqlRoleProvider">
<providers>
<remove name="AspNetSqlRoleProvider"/>
<add connectionStringName="ABCConnectionString"
applicationName="ABC"
name="ABCAspNetSqlRoleProvider"
type="System.Web.Security.SqlRoleProvider"/>
</providers>
</roleManager>
 
K

karlman

Thank you Muhammad, that is exactly what I was looking for. I think it
will be easier for this application to stay within the confines of the
supplied classes rather than trying to create everything myself. In
looking at the link John gave I should be able to extend the schema
using the Custom Membership User.

Thank you both!
Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top