locked
SSRS custom authentication - Authorization ticket not received by LogonUser RRS feed

  • Question

  • User-599324964 posted

    Hello i have a problem with SSRS Custom authentication. I followed the instructions here but reporting server get this error:

    Authorization ticket not received by LogonUser

    I was debugging code and I found out that error is in method ReportServerProxy.GetWebResponse:

    protected override WebResponse GetWebResponse(WebRequest request)
          {
             WebResponse response = base.GetWebResponse(request);
             string cookieName = response.Headers["RSAuthenticationHeader"];
             // If the response contains an auth header, store the cookie
             if (cookieName != null)
             {
                Utilities.CustomAuthCookieName = cookieName;
                HttpWebResponse webResponse = (HttpWebResponse)response;
                Cookie authCookie = webResponse.Cookies[cookieName];
                    // If the auth cookie is null, throw an exception
                    if (authCookie == null) 
                    {
                        throw new Exception(
                           "Authorization ticket not received by LogonUser");
                    }
                    // otherwise save it for this request
                    AuthCookie = authCookie;
                // and send it to the client
                Utilities.RelayCookieToClient(authCookie);
             }
             return response;
          }

    And i call this code in form:

    private void InitializeComponent()
          {
                ReportServerProxy server = new ReportServerProxy();
    
                string reportServer = ConfigurationManager.AppSettings["ReportServer"];
                string instanceName = ConfigurationManager.AppSettings["ReportServerInstance"]; //this constants are null
    
                // Get the server URL from the report server using WMI
                server.Url = AuthenticationUtilities.GetReportServerUrl("PC065", "MSSQLSERVER");
    
                server.LogonUser("user", "123", null); //throw exception
    
            }

    This is my configuration

    ReportServer\web.config:

    <authentication mode="Forms">
              <forms loginUrl="Pages\Logon.aspx" name="sqlAuthCookie" timeout="60" path="/"></forms>
          </authentication>
          <authorization>
              <deny users="?"/>
          </authorization>
          <identity impersonate="false" />

    ReportServer\rsreportserver.config:

    <Authentication>
            <AuthenticationTypes>
                <Custom />
            </AuthenticationTypes>
            <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
            <RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
            <EnableAuthPersistence>true</EnableAuthPersistence>
        </Authentication>
    
    <UI>
            <CustomAuthenticationUI>
                <loginUrl>/Pages/UILogon.aspx</loginUrl>
                <UseSSL>True</UseSSL>
            </CustomAuthenticationUI>
            <ReportServerUrl>http://localhost/ReportServer</ReportServerUrl>
        </UI>
        <Security>
            <Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity">
                <Configuration>
                    <AdminConfiguration>
                        <UserName>username</UserName>
                    </AdminConfiguration>
                </Configuration>
            </Extension>
        </Security>
        <Authentication>
            <Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.CustomSecurity"/>
        </Authentication>

    ReportManager\web.config:

    <appSettings>
        <add key="ReportServer" value="PC065" />
        <add key="ReportServerInstance" value="MSSQLSERVER"/>
      </appSettings>

    Please help me. I solve this problem for a very long time. My version of SQL Server is:

    Microsoft SQL Server 2008 R2 (SP3-OD) (KB3144114) - 10.50.6542.0 (X64) Feb 22 2016 18:07:23 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) (Hypervisor)

    Monday, January 2, 2017 12:35 PM

All replies