title: Login as different user using ADFS Authentication
body: <p>I am new to using ADFS in a web application and need some help.</p>
  
  <p>I have created a simple mvc web application and seem to have ADFS working (when I access the website it authenticates via the adfs server and redirects to my site). Now one of the features I want is for admins to be able to impersonate a user, on my site only so that they can see the site as if they were the impersonated user. If I login as John Smith, for example, then my HttpContext.Current.User is John Smith. I was able to do this on my old site quite easily because I could just set the auth cookie.</p>
  
  <p>So the question is is there a way to do this? </p>
  
  <p>Some code that may help understand my setup.</p>
  
  <p>Startup.Auth.cs</p>
  
  <pre><code>public partial class Startup
  {
      private static string realm = ConfigurationManager.AppSettings["ida:Wtrealm"];
      private static string adfsMetadata = ConfigurationManager.AppSettings["ida:ADFSMetadata"];
  
      public void ConfigureAuth(IAppBuilder app)
      {
          app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
  
          app.UseCookieAuthentication(new CookieAuthenticationOptions());
  
          app.UseWsFederationAuthentication(
              new WsFederationAuthenticationOptions
              {
                  Wtrealm = realm,
                  MetadataAddress = adfsMetadata
              });
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>