Showing posts with label https. Show all posts
Showing posts with label https. Show all posts

Monday, March 26, 2012

ReportViewer (ASP.NET) and Forms Authentication

I have successfully implemented forms authentication in RS. It works great to navigate to https://myserver/Reports. I get redirected to the login-page etc. It also works great to use the ReportViewer from within my WinForms app, using the

reportViewer.ServerReport.ReportServerCredentials.SetFormsCredentials

method. I'm also able to communicate with RS through it's web services by first calling the 'LogonUser' method. However, to get that to work I had to inherit the ReportExecutionService for the cookie-handling to work.

Now over to my problem (the only thing so far I haven't got working). I'm trying to use a ReportViewer on an ASP.net web page to access the reports. I have understood that 'SetFormsCredentials' is not avaliable here. Instead, as far as I have understood, I should implement my own IReportServerCredentials . The critical method there I guess is

GetFormsCredentials(out Cookie authCookie, out string formsUser, out string formsPassword, out string formsAuthority)

, am I right?

It's here my problem starts. The examples I have seen haven't implemented this method since they use other types of authentication. So, I would need an example of what to fill that method with...

Regards Andreas

Is there at least some documentation where I can read about this...?

(Can't find any examples on it...)

|||

After some more testing, I'm now able to render a report. This is possible if I implement the method like this:

public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)

{

authCookie = null;

user = "validUser";

password = "validPassword";

authority = "";

return true;

}

But from what I can understand this method should be returning a cookie...

And I have done testings with the method described here: http://blogs.msdn.com/bimusings/archive/2005/11/04/489100.aspx, but if I return something else then null as cookie-Value, I get an exception like this:

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.....

So, if I return null as cookie-value I'm able to render the report, but I run into trouble when clicking on a link in the report that navigates to another report. The report isn't rendered, instead the message

  • Execution 'lvzt54q0lq1nrbjjmmubr02b' cannot be found
    is shown.

    Any kind of help here would be of great value!

    Regards Andreas

  • Tuesday, March 20, 2012

    Reports over internet with Standard Edition Reporting Services

    Hello,
    I'm trying to view my reports over the internet.
    I can browse to https://www.mysite.com/reports and it prompts me to log in
    (integrated windows authentication) and I can view my list of reports.
    When I click on a report I recieve a basic "The page cannot be displayed"
    error.
    I even tried just "basic" authentication within IIS but still get the same
    error.
    The server hosts both components (SQL Server & IIS) on a Windows 2003 SP1.
    No special authentication, not a web farm, do I still need to get Enterprise
    edition?
    Help...
    Thanks in advance,
    GregCheck your IE address when you open your report, it must point to
    http://yourserver/reports. It point to your internal RS, that's why you can
    not open report from internet. It shows your list is because IIS is working.
    still no clue?
    check your config file. RSWebApplication.config under ReportManager
    change
    <ReportServerUrl>http://yourserver/reportserver</ReportServerUrl>
    to
    <ReportServerUrl>http://yourserver domain/reportserver</ReportServerUrl>
    and then visit
    http://your server domain/reports|||Thank you Wei Ming, this solved it for me.
    "Wei Ming" wrote:
    > Check your IE address when you open your report, it must point to
    > http://yourserver/reports. It point to your internal RS, that's why you can
    > not open report from internet. It shows your list is because IIS is working.
    > still no clue?
    > check your config file. RSWebApplication.config under ReportManager
    > change
    > <ReportServerUrl>http://yourserver/reportserver</ReportServerUrl>
    > to
    > <ReportServerUrl>http://yourserver domain/reportserver</ReportServerUrl>
    > and then visit
    > http://your server domain/reports
    >|||Also, is there a way during setup that would resolve this?
    "Wei Ming" wrote:
    > Check your IE address when you open your report, it must point to
    > http://yourserver/reports. It point to your internal RS, that's why you can
    > not open report from internet. It shows your list is because IIS is working.
    > still no clue?
    > check your config file. RSWebApplication.config under ReportManager
    > change
    > <ReportServerUrl>http://yourserver/reportserver</ReportServerUrl>
    > to
    > <ReportServerUrl>http://yourserver domain/reportserver</ReportServerUrl>
    > and then visit
    > http://your server domain/reports
    >|||I can not give u an answer for this, here is what I am thinking:
    during setup, it will gather information from your computer, and save that
    piece info into config file, if you can find that information ( for example,
    hosts or registry ) and modify it. Your RS can be auto configured after
    installation.
    What's the peticular reason you like to config this during setup?|||For future deployments, instead of having a client go into a config file, I'd
    rather have all of these settings done for them.
    I'm curious, how did you find this answer?
    "Wei Ming" wrote:
    > I can not give u an answer for this, here is what I am thinking:
    > during setup, it will gather information from your computer, and save that
    > piece info into config file, if you can find that information ( for example,
    > hosts or registry ) and modify it. Your RS can be auto configured after
    > installation.
    > What's the peticular reason you like to config this during setup?