Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Forms based authentication provider

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
karlman - 03 Sep 2007 18:24 GMT
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
John Mott - 03 Sep 2007 18:55 GMT
You need a "custom membership provider"  -- that will let you hook up to an
existing 'users' table, for instance.

http://msdn2.microsoft.com/en-us/library/f1kyba5e.aspx

john

> Is there a way to make a SQL 2005 server the provider for the user and
> roles database for form based authentication?
[quoted text clipped - 24 lines]
> Thank
> Karl
Muhammad Naveed Yaseen - 03 Sep 2007 20:05 GMT
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>
karlman - 03 Sep 2007 22:17 GMT
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

> I would have avoided implementing custom membership and role provider
> by myself because there already exist standard providers for Sql
[quoted text clipped - 42 lines]
>                         </providers>
>                 </roleManager>

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.