Wednesday, March 7, 2012

Pass RS SessionID via URL

Can anybody tell me if the following should work:
I am trying to start a report services session by calling the Render
method in code. This works fine - a session ID is generarted in the
SessionHeaderValue. Now, I would like to able to that same session
via URL. Here's the VB code snippit:
--
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rs.SessionHeaderValue = sh
result = rs.Render(sender_button.CommandArgument, format, history_id,
_
dev_info, parameter_values, credentials, show_hide_toggle, encoding,
_
mime_type, report_history_parameters, warnings, stream_ids)
Dim temp As String
temp = "http://localhost/ReportServer?%2fDemo+Project%2fMyReport&rs:Command=Render&rs:SessionID="
& rs.SessionHeaderValue.SessionID
Response.Redirect(temp)
--
The redirect works fine, but the Report Server pops up a login screen.
If I have already started the session, and pass the session ID, should
the login still be required?
Any insight on this would be appreciated.
Thanks,
TerryIs rs.Url the same as the root of your temp string? I.e. it's localhost, not
the machine name?
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Terry Romance" <tedgromance@.yahoo.com> wrote in message
news:f284ebe.0407230821.3a7bb882@.posting.google.com...
> Can anybody tell me if the following should work:
> I am trying to start a report services session by calling the Render
> method in code. This works fine - a session ID is generarted in the
> SessionHeaderValue. Now, I would like to able to that same session
> via URL. Here's the VB code snippit:
> --
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> rs.SessionHeaderValue = sh
> result = rs.Render(sender_button.CommandArgument, format, history_id,
> _
> dev_info, parameter_values, credentials, show_hide_toggle, encoding,
> _
> mime_type, report_history_parameters, warnings, stream_ids)
> Dim temp As String
> temp ="http://localhost/ReportServer?%2fDemo+Project%2fMyReport&rs:Command=Render&
rs:SessionID="
> & rs.SessionHeaderValue.SessionID
> Response.Redirect(temp)
> --
> The redirect works fine, but the Report Server pops up a login screen.
> If I have already started the session, and pass the session ID, should
> the login still be required?
> Any insight on this would be appreciated.
> Thanks,
> Terry|||Thanks for the reply, Tudor.
The Url of the reporting service is:
"http://localhost/ReportServer/ReportService.asmx" which matches the
root of the 'temp' string in the code.
Is there anything else I should check?
Thank you,
Terry
"Tudor Trufinescu \(MSFT\)" <tudortr@.ms.com> wrote in message news:<OyNbI52cEHA.2236@.TK2MSFTNGP10.phx.gbl>...
> Is rs.Url the same as the root of your temp string? I.e. it's localhost, not
> the machine name?
> --
> Tudor Trufinescu
> Dev Lead
> Sql Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Tudor,
Ignore my last reply. The URL's were the same on my development box, but
different on our live server. After I made sure they were the same on the live
server, it worked.
Thanks for your help!
Regards,
Terry|||Tudor:
I spoke too soon. It works only if I run it from the local machine. If
I try to access it from a remote machine via IE, it asks for authorization.
Thanks,
Terry|||If your app and RS are on different machines, you may be hitting the 2
machine hop limitation that exists in NTLM. NTLM credentials do not flow on
more than one machine.
client => your app => RS server
If you are on Windows 2003, you can use Kerberos, and enable delegation
between your app machine and the RS server machine. You could also use basic
auth over SSL (do not use it over plain HTTP as credentials are passed in
un-encrypted on the wire) or forms/custom authentication - but that requires
you write more code and has numerous other security implications.
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Terry Romance" <tedgromance@.yahoo.com> wrote in message
news:f284ebe.0407270626.253a9ee4@.posting.google.com...
> Tudor:
> I spoke too soon. It works only if I run it from the local machine.
If
> I try to access it from a remote machine via IE, it asks for
authorization.
> Thanks,
> Terry

No comments:

Post a Comment