1 Reply Latest reply: Dec 18, 2015 4:39 AM by Konrad Mattheis RSS

    AsStaticHeaderUserViaProxy

    Jean Philippe Golay

      Hi,

      We want to use a virtual proxy but set the "Authentication Method" to "Header authentication dynamic user directory"

      I have errors connecting using AsStaticHeaderUserViaProxy should have something as AsDynamicHeaderUserViaProxy

       

      I get the connections using rest sdk but how to achieve using .NET sdk?

        • Re: AsStaticHeaderUserViaProxy
          Konrad Mattheis

          Hi,

           

          do you mean DynamicHeader authentication with SessionID?

           

          You can use this:

           

           public static class LocationExtensions_akquinet
              {
                  public static void AsExistingSessionViaProxy(this ILocation location, string sessionId, bool useSsl = true, string cookieHeaderName = null)
                  {
                      var SecurityProperty = location.GetType().GetProperty("Qlik.Engine.ISecureLocation.Security", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
          
                      var Security = SecurityConfigurator.OpenAsExistingSessionViaProxy(sessionId, useSsl, cookieHeaderName ?? "X-Qlik-Session");
          
                      SecurityProperty.SetValue(location, Security);
                  }
          
                  private static PropertyInfo SecurityConfiguratorProperty = null;
                  internal static Qlik.Sense.Communication.Communication.Security.ISecurityConfigurator SecurityConfigurator
                  {
                      get
                      {
                          if (SecurityConfiguratorProperty == null)
                              SecurityConfiguratorProperty = typeof(LocationExtensions).GetProperty("SecurityConfigurator", BindingFlags.Static | BindingFlags.NonPublic);
                          return SecurityConfiguratorProperty.GetValue(null) as Qlik.Sense.Communication.Communication.Security.SecurityConfigurator;
                      }
                  }
              } 
          

           

          bye

          Konrad