Best practice to persist SSRS web service auth with forms authentication?


i have implemented the forms athentication security extension sample ssrs, noted here:
http://msftrsprodsamples.codeplex.com/wikipage?title=ss2008%21security%20extension%20sample&referringtitle=home
and here: (we using asp.net sql membership database)
http://blogs.msdn.com/bimusings/archive/2005/12/05/using-sql-reporting-services-2005-and-forms-authentication-with-the-whidbey-2-0-sqlmembershipprovider.aspx

i have working: sharing auth ticket between our asp.net site , ssrs server, allows user authenticated , authorized correctly when access report.  have authentication working for the ssrs web service, , have enabled ssrs web service use cookies.

i plan use the ssrs web service list of available reports, since appears api fetch list of available reports, using current user's roles, etc.

i changed our asp.net site logon page call logonuser() of ssrs web service.  works page, doesn't persist web service authentication on subsequent calls on other web pages (our reports page), because creating a new instance of web service proxy on our reports page.  to around this, i created instance of web service proxy object during login process, called logonuser(), , put object in session user upon login.  fetch object session on reports page, , can call listchildren() to list of reports user. it works, feels hack.  in addition being hack, the auth ticket cookie times out if user doesn't access reports page before timeout period. after our users login main site page, they may or may not go our reports page within timeout period.

the security extension samples good, , dicuss accessing report service access urls of reports, don't offer lot of information using web service lists of available reports web service, , how integrate existing site.  i'm not posting code, because it's exact implementation of sample.

my question is: best practice accessing web service proxy on subsequent pages user visits, after forms login?  supposed creating new instance of proxy on subsequent pages?  should calling without invoking logonuser() on subsequent calls?

thanks

i have same exact issue. getting around re-logging in on reports list page every time user hits it. when user clicks on report link, take them page reportviewer control , pass cookie in so:

reportviewer1.processingmode = microsoft.reporting.webforms.processingmode.remote             reportviewer1.serverreport.reportserverurl = new uri(configurationmanager.appsettings("ssrsrptsvr").tostring())             reportviewer1.serverreport.reportpath = ddlreports.selectedvalue              'set ssrs report credentials.             dim authcookie new cookie(cookie.name, cookie.value)             authcookie.domain = configurationmanager.appsettings("domainname").tostring()             reportviewer1.serverreport.reportservercredentials = new rptservercreds(authcookie)              'add account id or company parameter report.             dim parms new list(of microsoft.reporting.webforms.reportparameter)()              parms.add(new microsoft.reporting.webforms.reportparameter("accountid", mysession.accountid, false))             parms.add(new microsoft.reporting.webforms.reportparameter("groupid", "2", false))              me.reportviewer1.serverreport.setparameters(parms)             reportviewer1.serverreport.refresh()             reportviewer1.visible = true

rptservercreds inherits ireportservercredentials can implement "getformscredentials" method so...

namespace microsoft.samples.reportingservices.customsecurity {     [serializable]     public class rptservercreds : ireportservercredentials     {         private cookie m_authcookie;          public rptservercreds(cookie authcookie)         {             m_authcookie = authcookie;         }          public windowsidentity impersonationuser         {                         {                 return null;  // use default identity.             }         }          public icredentials networkcredentials         {                         {                 return null;  // not using networkcredentials authenticate.             }         }          public bool getformscredentials(out cookie authcookie,             out string user, out string password, out string authority)         {             authcookie = m_authcookie;             user = password = authority = null;             return true;  // use forms credentials authenticate.         }     } }

this pretty took care of everything. don't idea of carrying around proxy server object.

i aware making 2 calls instead of 1 (one log in , other report children), have make call anyway latest report children.



SQL Server  >  SQL Server Reporting Services, Power View



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........