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?
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?