473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Applications sharing Forms Authentication

Hello,
I am attempting to share forms authentication between two applications
but running into problems. The documentation I've been able to dig up
says (to summarize) if the the Web.Config settings are the same between
the apps they should work happily together. The only difference I have
between the apps Web.Config settings is their <forms> loginUrl, which
isn't supposed to make a difference.

App1 Web.Config:
<authentication mode="Forms">
<forms name="AuthenticationCookie"
loginUrl="login.aspx"
protection="All"
timeout="30"
path="/"/>
</authentication>

App2 Web.Config:
<authentication mode="Forms">
<forms name="AuthenticationCookie"
loginUrl="/App1/login.aspx"
protection="All"
timeout="30"
path="/"/>
</authentication>

You'll note that the the only change is loginUrl for App2 is updated to
point to the login form of App1.

Both apps have the same <authorization> tag:
<authorization>
<deny users="?" /> <!-- Deny all users -->
</authorization>

Neither app is set to encrypt the cookie data.

The problem is that I never get sent back to the calling page in App2.
The return url is correct (as seen in the address bar of the browser
after being redirected to the login page). But after being
authenticated, I just get redirected to the login page again. Login
failures are being handled correctly, so I know I'm typing the
username/password correctly.

Any thoughts?
Apr 7 '06 #1
5 1502
This is because you being authenticated in App1 not App2. AFAIK, you cant
run two sessions in the same browser window. If you used Windows Integrated
security, you could negate this issue altogether, but that of course depends
on your configuration IE are these people all on a local nt network ?
--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net


"Sebastian" <no****@undelivered.com> wrote in message
news:O0**************@TK2MSFTNGP02.phx.gbl...
Hello,
I am attempting to share forms authentication between two applications but
running into problems. The documentation I've been able to dig up says
(to summarize) if the the Web.Config settings are the same between the
apps they should work happily together. The only difference I have
between the apps Web.Config settings is their <forms> loginUrl, which
isn't supposed to make a difference.

App1 Web.Config:
<authentication mode="Forms">
<forms name="AuthenticationCookie"
loginUrl="login.aspx"
protection="All"
timeout="30"
path="/"/>
</authentication>

App2 Web.Config:
<authentication mode="Forms">
<forms name="AuthenticationCookie"
loginUrl="/App1/login.aspx"
protection="All"
timeout="30"
path="/"/>
</authentication>

You'll note that the the only change is loginUrl for App2 is updated to
point to the login form of App1.

Both apps have the same <authorization> tag:
<authorization>
<deny users="?" /> <!-- Deny all users -->
</authorization>

Neither app is set to encrypt the cookie data.

The problem is that I never get sent back to the calling page in App2. The
return url is correct (as seen in the address bar of the browser after
being redirected to the login page). But after being authenticated, I
just get redirected to the login page again. Login failures are being
handled correctly, so I know I'm typing the username/password correctly.

Any thoughts?

Apr 8 '06 #2
They aren't on all on a local NT network, but forms authentication is
supposed to work across applications; see:
<http://msdn2.microsoft.com/en-US/library/eb0zx8fc(VS.80).aspx>

I don't see any reason to doubt this possibility either...both apps are
running on the same server and giving the cookie the same name. Can
anyone clarify what I'm missing here?

Sebastian

OHM ( One Handed Man ) wrote:
This is because you being authenticated in App1 not App2. AFAIK, you cant
run two sessions in the same browser window. If you used Windows Integrated
security, you could negate this issue altogether, but that of course depends
on your configuration IE are these people all on a local nt network ?

Apr 10 '06 #3
Perhaps since I'm not defining a <machineKey> the validationKey is being
set to "autogenerate" making the second app unable to decrypt the cookie
data the first app is creating.

-Seb.
Apr 10 '06 #4
That does look to be the issue. When I explicitly set the machineKey to
the same values in both Web.Config files, everything works fine. Does
anyone know if there is a way to auto-generate keys so the two apps can
share Forms Authentication w/o having to set the machineKey explicitly?
Apr 10 '06 #5
Fair point, I know I have tried this in the past and didnt think this was
possible, so you have taught me somthing.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Sebastian" <no****@undelivered.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
They aren't on all on a local NT network, but forms authentication is
supposed to work across applications; see:
<http://msdn2.microsoft.com/en-US/library/eb0zx8fc(VS.80).aspx>

I don't see any reason to doubt this possibility either...both apps are
running on the same server and giving the cookie the same name. Can
anyone clarify what I'm missing here?

Sebastian

OHM ( One Handed Man ) wrote:
This is because you being authenticated in App1 not App2. AFAIK, you cant
run two sessions in the same browser window. If you used Windows
Integrated security, you could negate this issue altogether, but that of
course depends on your configuration IE are these people all on a local
nt network ?

Apr 11 '06 #6

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

Similar topics

1
by: JC | last post by:
I have several applications that use forms authentication and they are currently setup to use a single login page. Everything works fine under v1.0 of the framework and everything works fine if I...
1
by: John Saunders | last post by:
I have an existing ASP.NET 1.0 application at the root of a web site. There is another 1.0 application in a virtual directory under the root. Forms Authentication works fine between the two. ...
4
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in...
3
by: Mothish K | last post by:
Hello, I am trying to connect 2 of my asp.net applications using context.items collections to share the variables. but it says Could not load type 'Proj2.SignIn'. I have set the...
1
by: cab0san | last post by:
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 ...
0
by: Nabani Silva | last post by:
Hi, hope someone could help I need to share session state (and contents) through differente web applications. I'm trying to get it done by using StateServer session state, below I paste code...
1
by: Tod Birdsall, MCSD for .NET | last post by:
Hi All, I have two ASP.NET applications which I am trying to have share forms authentication. But I am running into problems. App A is an ASP.NET 2.0 Beta 2 application. App B is an ASP.NET...
16
by: Daniela Roman | last post by:
Hello, can someone tell me the main differences between the web and windows based applications? thank you
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.