title: Azure Active Directory Sign out Error
body: <p>I've created a generic website from visual studio 2013 and successfully wired it up to an existing Azure Active Directory instance for authentication. I can login as any user in the Azure AD with the appropriate credentials. Unfortunately I can not sign out without receiving this error: </p>
  
  <blockquote>
    <p>AADSTS50068: Signout failed. The initiating application is not a
    participant in the current session.</p>
  </blockquote>
  
  <p>I've googled the error number, but apparently I'm the first person to ever encounter this....:) I'm pretty sure I'm not, but I'm now at a loss to explain why sign in works, but sign out does not.</p>
  
  <p>Here is the sign out code, pretty much exactly as it was generated:</p>
  
  <pre><code>public ActionResult SignOut()
          {
              WsFederationConfiguration config = FederatedAuthentication.FederationConfiguration.WsFederationConfiguration;
  
              // Redirect to SignOutCallback after signing out.
              string callbackUrl = Url.Action("SignOutCallback", "Account", routeValues: null, protocol: Request.Url.Scheme);
  
              SignOutRequestMessage signoutMessage = new SignOutRequestMessage(new Uri(config.Issuer), callbackUrl);
              signoutMessage.SetParameter("wtrealm", IdentityConfig.Realm ?? config.Realm);
              string signoutMsg = signoutMessage.WriteQueryString();
  
              FederatedAuthentication.SessionAuthenticationModule.SignOut();      
  
              return new RedirectResult(signoutMsg);
          }
  </code></pre>