1
votes

I have a question regarding SSRS authentication. I have deployed my reports on a live server and after I access these reports using the live URL it shows "authentication failed" error. My purpose is that anyone from the universe can access the reports but how can I do that? i.e let everyone access that specific URL to see the reports. I am using SQL Server Authentication here.

It runs fine when I run that application on the local server because it has rights to access the that report but the story starts when I try to access the report placed on the live server.

Thanks in advance

2

2 Answers

0
votes

if you want allow public to accuses it your report, you need to use report viewer control, with out that is is very long process, to allow report server to be accessible to public. so the easy why is .

  1. create new page and in form tag past bellow code

    <rsweb:ReportViewer ID="MainReportViewer" runat="server" BackColor="White" 
                    Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos=" (Collection)" 
                    ProcessingMode="Remote" ShowBackButton="False" ShowFindControls="False" 
                    ShowPageNavigationControls="False" SizeToReportContent="True" 
                    ToolBarItemBorderColor="White" ToolBarItemHoverBackColor="White" 
                    WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">
                    <ServerReport 
                        ReportServerUrl="" />
                </rsweb:ReportViewer> 
    
  2. below code help you to set you report path, user name,password and etc, that help to accuses your report, please past the below code in to CA file

    protected void Page_Init(Object sender, EventArgs e) {

        string UserName = ConfigurationManager.AppSettings["SsrsUserName"];
        string Password = ConfigurationManager.AppSettings["SsrsPassword"];
        string Domain = ConfigurationManager.AppSettings["SsrsDomain"];
        string ReportServerRoot = ConfigurationManager.AppSettings["SsrsServerRoot"];
        string ReportServerPath = ConfigurationManager.AppSettings["SsrsReportServerPath"];
    
        MainReportViewer.ProcessingMode = ProcessingMode.Remote;
        IReportServerCredentials irsc = new CustomReportCredentials(UserName, Password, Domain);
        MainReportViewer.ServerReport.ReportServerCredentials = irsc;
        MainReportViewer.ServerReport.ReportServerUrl = new Uri(ReportServerRoot);
        MainReportViewer.ServerReport.ReportPath = ReportServerPath + "YourReportFileName";
    

    }

0
votes

Sorry for delayed Reply. please find customreportcreadentials class :- public class CustomReportCredentials : Microsoft.Reporting.WebForms.IReportServerCredentials { private string _UserName; private string _PassWord; private string _DomainName;

    public CustomReportCredentials(string UserName, string PassWord, string DomainName)
    {
        _UserName = UserName;
        _PassWord = PassWord;
        _DomainName = DomainName;
    }
    public CustomReportCredentials(string UserName, string PassWord)
    {
        _UserName = UserName;
        _PassWord = PassWord;
    }
    public System.Security.Principal.WindowsIdentity ImpersonationUser
    {
        get { return null; }
    }

    public ICredentials NetworkCredentials
    {
        get { return new NetworkCredential(_UserName, _PassWord, _DomainName); }
    }

    public bool GetFormsCredentials(out Cookie authCookie, out string user,
     out string password, out string authority)
    {
        authCookie = null;
        user = password = authority = null;
        return false;
    }
}