FormsAuthentication across applications on differents machines

P

Portos75

Hello,

I'm implementing a single sign on for 3 applications in intranet with
aspnet1.1:

http://machine1.es.group/App
http://machine1.es.group/App2
http://AnotherMachine.es.group/App

I've read about FormsAuthentication accross aplications and i have in all
webconfigs the validationkey, decriptionkey, and configured the
authentication like this:

<authentication mode="Forms" >
<forms loginUrl="login.aspx" protection="All" timeout="30" path="/" >
</forms>

It works beetwen App and App2 on the same machine but it doesn't work for
App in the different machine.

I have tried indicating the domain in the cookie but it doesn't work. Here
are the code for the login button after validate the user against database:

HttpCookie oAuthCookie=FormsAuthentication.GetAuthCookie(txtUser.Text, false);
oAuthCookie.Domain="es.group";
Response.AppendCookie(oAuthCookie);

String sRedirectUrl=FormsAuthentication.GetRedirectUrl(txtUser.Text,
chkPersistent.Checked);
Response.Redirect(sRedirectUrl, false);

I've tried to verify the domain of the cookie with this code but the domain
property is always empty.

String sRet =null;

HttpCookie oCookie=null;
// cookies
for (Int32 i=0; i< Request.Cookies.Count; i++)
{
oCookie=Request.Cookies;
sRet += String.Format("<BR>{0}, Domain=[{1}], Path=[{2}], Expires=[{3}],
Secure=[{4}] ", oCookie.Name, oCookie.Domain, oCookie.Path, oCookie.Expires,
oCookie.Secure);
}

Any ideas?
 
D

Dominick Baier [DevelopMentor]

Hello Portos75,

you have to "instruct" IE to send the auth cookie to another machine that
were the cookie originally came from - the the domain property of the cookie
to

".es.group"
 
P

Portos75

Hello Dominick,

I have already tried to do that like I have said in my last message.
Maybe I'm doing something wrong.

Have you seen the code of my last message? Am I doing something wrong?
How should I do that?
Dou you know why When I get the domain from the cookie is always empty?

I have tried to insert a point before es.group as you "comment" in your post
but it does'nt work too.

Thanks in advance,

Dominick Baier said:
Hello Portos75,

you have to "instruct" IE to send the auth cookie to another machine that
were the cookie originally came from - the the domain property of the cookie
to

".es.group"

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hello,

I'm implementing a single sign on for 3 applications in intranet with
aspnet1.1:

http://machine1.es.group/App
http://machine1.es.group/App2
http://AnotherMachine.es.group/App
I've read about FormsAuthentication accross aplications and i have in
all webconfigs the validationkey, decriptionkey, and configured the
authentication like this:

<authentication mode="Forms" >
<forms loginUrl="login.aspx" protection="All" timeout="30"
path="/" >
</forms>
It works beetwen App and App2 on the same machine but it doesn't work
for App in the different machine.

I have tried indicating the domain in the cookie but it doesn't work.
Here are the code for the login button after validate the user against
database:

HttpCookie oAuthCookie=FormsAuthentication.GetAuthCookie(txtUser.Text,
false);
oAuthCookie.Domain="es.group";
Response.AppendCookie(oAuthCookie);
String sRedirectUrl=FormsAuthentication.GetRedirectUrl(txtUser.Text,
chkPersistent.Checked);
Response.Redirect(sRedirectUrl, false);
I've tried to verify the domain of the cookie with this code but the
domain property is always empty.

String sRet =null;

HttpCookie oCookie=null;
// cookies
for (Int32 i=0; i< Request.Cookies.Count; i++)
{
oCookie=Request.Cookies;
sRet += String.Format("<BR>{0}, Domain=[{1}], Path=[{2}],
Expires=[{3}],
Secure=[{4}] ", oCookie.Name, oCookie.Domain, oCookie.Path,
oCookie.Expires,
oCookie.Secure);
}
Any ideas?

 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top