Score:0

SSRS Sql Server Reporting Server Custom Security 2019 exception in Windows Server 2019

lc flag

I am facing a problem with respect to SSRS(Sql Server Reporting Server) 2019 Custom security Exception in windows server 2019.

SSRS report works fine from winforms vb.net code in previous version of SQL Server (2016, 2014 and 2012) but not in 2019.

Running report using Vb.net Winforms source code and sending WebRequest to SSRS server with necessary details like server url,username ,password, DBName etc, with response back using webResponse need to get authentication cookie for the User

Getting error as sqlAuthCookie is null, also getting an error as Custom security exception is not enabled

Anything solution/help would be highly appreciated

Attached the Piece of code which sending from vb.net and getting response from SSRS server.

VB.NET Code
Protected Overrides Function GetWebResponse(ByVal request As WebRequest) As WebResponse
        Dim response As WebResponse = MyBase.GetWebResponse(request)
        Dim cookieName As String = response.Headers("RSAuthenticationHeader")
        ' If the response contains an auth header, store the cookie
        If Not (cookieName Is Nothing) Then
            Dim webResponse As HttpWebResponse = CType(response, HttpWebResponse)
            Dim authCookie As Cookie = webResponse.Cookies(cookieName)
            ' If the auth cookie is null, throw an exception
            If authCookie Is Nothing Then
                Throw New Exception("Unable to generate report - the Reporting Services Custom Security Extension is expected to be enabled in XB")
            End If
            ' otherwise save it for this request
            Me.AuthCookie = authCookie
            ' and send it to the client
        End If
        Return response

    End Function
//adding new GetUserInfo method for IAuthenticationExtension2
       public void GetUserInfo(IRSRequestContext requestContext, out IIdentity userIdentity, out IntPtr userId)
       {
           userIdentity = null;
           if (requestContext.User != null)
           {
               userIdentity = requestContext.User;
           }

           // initialize a pointer to the current user id to zero
           userId = IntPtr.Zero;
       }
cn flag
Did it contain the header RSAuthenticationHeader? Seems like an obvious thing to check first.
Gurudath R avatar
lc flag
Yes it contains RSAuthenticationHeader
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.