474,051 Members | 46,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOWTO: Add User To Membership System After Being Windows Authentic

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.Serverv ariables("LOGON _USER"), contrive a password and email address,
and do a Membership.Crea teUser.

How do I programmaticall y login a user?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 24 '06 #1
2 1427
Hi Dan,

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

FormsAuthentica tion.SetAuthCoo kie _
("JackieReev e", True)

Is that what you meant?

Ken
Microsoft MVP [ASP.NET]
"Dan Sikorsky" <Da*********@di scussions.micro soft.comwrote in message
news:80******** *************** ***********@mic rosoft.com...
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.Serverv ariables("LOGON _USER"), contrive a password and email
address,
and do a Membership.Crea teUser.

How do I programmaticall y login a user?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS

Jul 24 '06 #2
Yes, it is ... thanks.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Ken Cox [Microsoft MVP]" wrote:
Hi Dan,

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

FormsAuthentica tion.SetAuthCoo kie _
("JackieReev e", True)

Is that what you meant?

Ken
Microsoft MVP [ASP.NET]
"Dan Sikorsky" <Da*********@di scussions.micro soft.comwrote in message
news:80******** *************** ***********@mic rosoft.com...
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.Serverv ariables("LOGON _USER"), contrive a password and email
address,
and do a Membership.Crea teUser.

How do I programmaticall y login a user?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS


Jul 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1922
by: Peter Tragardh | last post by:
I'm searching for info on how to authenticate a user in the same way that for example Source Safe does. I would like my system to use Windows as the authenticator, so that the user doesn't have to log on separately to access my system.
0
3259
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another way... here is my code on how I did it to help anyone starting out get an idea of how to use virtual mode in ..NET 2.0 Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared
0
1715
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application became realllllllllllly slow. Content in LoginView Role Groups was not displaying even after a user in a role had logged in. It was taking about 15 seconds or so for the login control to display when the login link was selected on the homepage....
8
4928
by: Mark White | last post by:
Hey everyone I'm having a great deal of problems finding this information through google and yahoo, so I turn to you on this. I have a Windows app running on XP. I am able to caputre the user's Name property in the WindowsPrincipal's IIdentity interface. Where can I find the role that the user is assigned for the current login? I only want the one role which is assigned for the current user, not all of
5
2063
by: Vishal Gupta | last post by:
Hi This is Vishal this side.I have been trying to create a new sample website using the new Membership Provider Class. Now when I try to a create a new website and then hit on the Website Administrator Tool and then hit on Security I get this error "There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can
3
2529
by: Dan Sikorsky | last post by:
How do you get a reference to the LoginStatus control contained in the LoginView control that resides on web.master? I need to determine if the LoginStatus will show a LogOut link(for a logged in user), or show nothing at all (in the case of the user not logged in); Are there any other Membership properties that I can call that tell if the user has already authenticated.? --
3
2376
by: Electrified Research | last post by:
So I've been playing with WebParts. Very cool stuff. The personalization scope has "Shared" and "User". "Shared" allows for an admin to customize a page and how other users see that page. "User" allows for that user to customize a page how they specifically want. What I want to do is a fusion of the the two. The personaliztion settings appear to be based on the request path. For example. /Default.aspx and /MyPage.aspx can have...
2
3210
by: =?Utf-8?B?Z292ZXI=?= | last post by:
Hello, I want to provide the ability to log on to a web application on our intranet using different credentials like they do in Sharepoint 2007. When a user hits the site, i want him automatically loggged in using his windows credentials, but be able to swicth to different windows credentials from within the web app. How do I go about doing this? My current configuration is: <authentication mode="Windows" /> <identity...
4
3803
by: Brett | last post by:
I have an ASP.NET 2.0 application that uses Forms Authentication. The startup page contains just a login control, and the site works well on an IIS 6 web server. I am now setting the site up on the production web server, which runs Windows 2008 Server and IIS 7. The login page comes up, but when I try to log in, I get the error, "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." For debugging...
0
10562
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
12058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
11151
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8727
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6677
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4954
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3993
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.