473,748 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms Authentication for multiple applications

I have several applications all on the same server. I would like them
to all use the same login page.

Example:
http://server1/customers/app1.aspx
http://server1/suppliers/byregion/app2.aspx

I have a login page located in the root of the same server:
http://server1/login.aspx

None of these are virtual directories.

The web.config file for customers/ and suppliers/byregion/ looks like
this:

<authenticati on mode="Forms">
<forms loginUrl="/login.aspx" name=".ASPXAUTH " timeout="30" path="/"
protection="All ">
</forms>
</authentication>
<authorizatio n>
<deny users="?" />
<allow users="*" />
</authorization>

The web.config for the root web looks like this
<authenticati on mode="Forms">
<forms loginUrl="login .aspx" name=".ASPXAUTH " timeout="30" path="/"
protection="All ">
</forms>
</authentication>
<authorizatio n>
<deny users="?" />
<allow users="*" />
</authorization>

Both apps are configured to allow anonymous in iis.

The login page code looks like this:

Dim tkt As FormsAuthentica tionTicket
tkt = New FormsAuthentica tionTicket(1, Me.txtUser.Text , DateTime.Now(),
DateTime.Now.Ad dMinutes(30), True, "<group info would go here>")
Dim cookiestr As String
cookiestr = FormsAuthentica tion.Encrypt(tk t)
Dim ck As HttpCookie
ck = New HttpCookie(".AS PXAUTH", cookiestr)
ck.Expires = tkt.Expiration
ck.Path = "/"
Response.Cookie s.Add(ck)
Dim strRedirect As String
strRedirect = Request("Return URL")
Response.Redire ct(strRedirect)

When I request a page in customers, like
http://server1/customers/app1.aspx, I am redirected to the login page
(good), bet when I click logon and run the above code, it just returns
to the login page again (bad).
The "ReturnURL" is correct, as I have seen in debug mode.

I'm guessing that app1 is rejecting my cookie, and returning me to the
login page again, but why?

I must be missing something simple. Any ideas?

Nov 19 '05 #1
1 2531
If anyone is interested, I found the answer here.

http://weblogs.asp.net/hernandl/arch...formsauth.aspx

Basically, it had to do with the "IsolateApp s" setting and the machine
key settings in the machine.config file.

Nov 19 '05 #2

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

Similar topics

9
4637
by: Hermit Dave | last post by:
Hi, I am making a web application (rather two applications) one which is host and used by customers when they are just browsing through products. The second application resides on a secure server. This is going to hold all account related information for the customers and will also be used for admin The login is implemented using forms authentication and i was just reading up about that... but as everyone already knows.... its all...
7
2496
by: dave | last post by:
I have one application that is used within our intranet that places a forms auth cookie for our domain (for intranet purposes only). All other applications rely on this cookie for authentication and user identification. i.e. on the 2nd applications if the cookie does not exist the user is redirected back to the primary app to get the forms authentication cookie Now, if i want to run locally the 2nd application it is looking for a...
2
259
by: Brian Shannon | last post by:
I have an intranet site I created when I first began .NET and it is very basic. Now that I have developed my skills I am looking to revamp the old with something new. I really like the idea of using forms authentication. My problem is with assigning roles. The documents I have read talks about assigning roles in the web.config file. This seems like it would be very tedious to manage. Currenly I have all roles stored in a SQL 2000 DB...
2
1516
by: Vaibhav Gadodia | last post by:
Hello, I am trying to build an application which has forms authnetication enabled. I have a non-persistent authentication cookie which is exactly what i want. The problem is when i use two independent browser windows to access the application. Both of them require authentication. Is there any way where i have to login only once from a given machine
1
1730
by: Jéjé | last post by:
Hi, I have to implement a security like this: 1. The user is logged into a home made extranet in PHP, a directory server is used (not the active directory) (its a form based authentication) 2. the user click on a link on the extranet application and jump to another server & application which is my ASPX application I want to be able to keep the login of the user, so the user is directly authenticated.
1
2403
by: o0JoeCool0o | last post by:
I currently have forms authentication set up for my application, I have 2 different projects in the solution and I have one single login page residing in solution #1 My web.config is the same in both projects and works fine in IE you can login the one page and the authentication works when your try redirect to any page in either project. However in firefox if I login in project1 and then try to load a page from project 2 I get booted to...
2
2127
by: o0JoeCool0o | last post by:
Has anyone else tried this? I have been messing with this for a week and cant figure it out, for some reason firefox will not read an authentication cookie unless it was set by the applciation that your trying to load. Where as IE will read the authentication cookie if it has the same name (as specified in web.config) regardless of which application your in.
4
1767
by: David | last post by:
Hi all, I have a problem with Forms Auth. I am not using the protected folder method, rather, I want some parts of the page to be shown depending on the authentication state. Basically, I have a dashboard application. In the dashboard, I have various hyperlinks and linkbuttons. I have also created roles and each user will be assigned a role and the buttons in the dashboard will depend on the role. If the person is not authenticated,...
4
3603
by: =?Utf-8?B?RmFyaWJh?= | last post by:
It know that we can use the following method http://msdn2.microsoft.com/en-us/library/eb0zx8fc.aspx to form authenticate across multiple applications. I have created an asp.net application that supports form authentication. My application is going to be called by another legacy application (HTML) which does the initial authentication.Something like this: <form name="form1" action="auth.asp" method="post" >
2
2049
by: TimVtoo | last post by:
Hi, thanks for your time. I have 2 almost identical asp.net (vb) applications. 1 Development and 1 Production. They use forms authentication that is configured to run in SQL server. Both apps use the same aspnetdb database but have different application names. The problem I have is: I have an Identical login for each app (same username, same password), but If I change profile information for that user in the development app, the changes...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9324
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
9247
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
8243
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...
0
4606
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...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
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
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.