问题
I am trying to set up a VM with SSRS report server. The SSRS reports on the report server has to be accessible from an iframe on another web site / server.
When I'm accessing the report server URL on an external computer browser I have to enter credentials for the VM user. On the following link it says that anonymous authentication is unsupported: https://technet.microsoft.com/en-us/library/cc281310(v=sql.105).aspx
The only solution I have at the moment is to enter the credentials in the URL like "http:userLogin:userPassword@myDomain.com/ReportServer". However this solution exposes my VM user in the iframe code.
How do I set up my SSRS server so I can access the SSRS reports from any computer's browser without having to enter VM credentials? Is there an alternate solution to anonymous authentication in this scenario?
Thanks in advance
回答1:
You can provide a custom auth extension for SSRS that handles security. And while these are a bit complex, a custom auth extension that enables anonoymous access is trivial.
See https://docs.microsoft.com/en-us/sql/reporting-services/security/authentication-with-the-report-server
and the SSRS 2016 sample here: https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample2016
You can also proxy traffic to SSRS using your own HTTP handlers or perhaps IIS ARR. If doing by hand you would configure SSRS to use HTTP Basic auth and add the basic auth header when you make the HTTP request from your application.
回答2:
I have to find out, and the solution that is working for me It was set Basic Authentication into SSRS , this into the file:rsreportserver.config of ReportServer
<AuthenticationTypes> <RSWindowsBasic/> </AuthenticationTypes>
--------------------------------------------------------------
**and into the code:**
String url="http://<ipreportserver>:8080/ReportServer?/MyReport&rc:Parameters=false&rs:Command=Render&rs:Format=PDF";
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new
System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
var byteArray = Encoding.ASCII.GetBytes("myuser:myuserPwd");
client.DefaultRequestHeaders.Authorization = new
System.Net.Http.Headers.AuthenticationHeaderValue("Basic",
Convert.ToBase64String(byteArray));
try
{
httpResponse = await client.GetAsync(url);
if (httpResponse.IsSuccessStatusCode)
.....
I hope this will help.. thank you
来源:https://stackoverflow.com/questions/48688729/setting-up-ssrs-server-with-alternative-to-anonymous-authentication