asp.net - Forms authenticated on one web server, would like to be authenticated on another too -
we're using forms authentication (iis 7 , asp.net 3.5) on our domain, www.ourbusiness.com , having no problems. wish add additional asp.net servers on different domain --newapp.ourbusiness.com-- , things such has been authenticated on www.ourbusiness.com authenticated on newapp.ourbusiness.com.
i've seen scattered reports on how go this, provide additional guidance? understanding example, want servers use same machine key authentication cookie on 1 box others, we're doing on www.ourbusiness.com domain. i'm not sure else required or if there articles explaining steps involved. , help.
you handle creating formsauthenticationticket , httpcookie yourself. way can set domain cookie handle subdomains. said servers need have same machine key well.
formsauthenticationticket ticket = new formsauthenticationticket(1, username, datetime.now, datetime.now.addminutes(30), ispersistent, userdata, formsauthentication.formscookiepath); // encrypt ticket. string encticket = formsauthentication.encrypt(ticket); // create cookie. var cookie = new httpcookie(formsauthentication.formscookiename, encticket) cookie.domain = ".ourbusiness.com"; response.cookies.add(cookie);
Comments
Post a Comment