HOWTO: Add User To Membership System After Being Windows Authentic

G

Guest

My website users will all come from the same domain after they first login to
the network in the morning; therefore I would like to use the benefits of
Windows Authentication. But I would like to use the benefits of the
Membership system for things like controlling access to certain web pages
using Roles, password retrieval, etc.

I think the best way to use both authentication systems is to declare Forms
authentication in the web.config file, but to get the username from
Request.Servervariables("LOGON_USER"), contrive a password and email address,
and do a Membership.CreateUser.

How do I programmatically login a user?
 
K

Ken Cox [Microsoft MVP]

Hi Dan,

If you've got the user's name you can log the user in like this:

FormsAuthentication.SetAuthCookie _
("JackieReeve", True)

Is that what you meant?

Ken
Microsoft MVP [ASP.NET]
 
G

Guest

Yes, it is ... thanks.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS


Ken Cox said:
Hi Dan,

If you've got the user's name you can log the user in like this:

FormsAuthentication.SetAuthCookie _
("JackieReeve", True)

Is that what you meant?

Ken
Microsoft MVP [ASP.NET]
 

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

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top