title: Single Sign On for windows authentication
body: <p>How can we achieve single signOn for windows authentication where my two applications which are available on internet are configured in iis for windows authentication. On requesting the url there is a popup of windows authentication, so I want there should not be popup for 2nd application if 1st is authenticated.</p>
  
  <p>I have created two application SSO1 and SSO2 on SSO1 Login page I am writing code</p>
  
  <pre><code>protected void btnLogin_Click(object sender, EventArgs e)
         {
             if (txtUserName.Text == "test" &amp;&amp; txtPassword.Text == "test")
             {
                 string guid = Guid.NewGuid().ToString();              
                 Response.Cookies.Add(new HttpCookie("eNPSAuthToken", guid));                              
                 Response.Redirect("Default.aspx");
             }
             else
                 Response.Write("Invalid User");
         }
  </code></pre>
  
  <p>On SSO2 application default page I am writing code to check the cookie if available redirect it to default page or else login page of SSO2 application.</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
          {
              if (Request.Cookies["eNPSAuthToken"] == null)
              {                                           
                  Response.Redirect("Login.aspx");
              }
          }
  </code></pre>
  
  <p>I need to host both the application on IIS and enable windows authentication, So I will get login popup of windows authentication, I want to get popup only once, if user is authenticated then for 2nd application popup should not come.</p>