title: Calling SSRS Report Server it asked "Authentication Required" window
body: <p>I have just started working in SSRS and I got a very strange problem i.e. When I am calling report server URL i.e. localhost/Reports</p>
  
  <p>This URL requires Authentication window for Username and password. like this.
  <img src="https://i.stack.imgur.com/r0C33.jpg" alt="enter image description here"></p>
  
  <p>If I submitted local system user account information in that case it will appear me report server screen which we want. like this.
  <img src="https://i.stack.imgur.com/ahsT9.jpg" alt="enter image description here"></p>
  
  <p>I have created a demo web-application and in the default.aspx page I am using <code>ReportViewer</code> to show report and configure it. here is the code which i am using
  <code>Default.aspx</code> Page</p>
  
  <pre><code>&lt;rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="100%"&gt;
  &lt;/rsweb:ReportViewer&gt;
  </code></pre>
  
  <p><code>Default.aspx.cs</code> Page</p>
  
  <pre><code>    ReportViewer1.ProcessingMode = ProcessingMode.Remote;
      IReportServerCredentials irsc = new CustomReportCredentials("username", "password", "India");
      ReportViewer1.ServerReport.ReportServerCredentials = irsc;
      ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/Reports");
      ReportViewer1.ServerReport.ReportPath = "/SSRS_Demo/Report_CaseMain";
      ReportViewer1.ServerReport.Refresh(); 
  </code></pre>
  
  <p><code>CustomReportCredentials.cs</code> Class</p>
  
  <pre><code>public class CustomReportCredentials : IReportServerCredentials
      {
          // local variable for network credential.
          private string _UserName;
          private string _PassWord;
          private string _DomainName;
          public CustomReportCredentials(string UserName, string PassWord, string DomainName)
          {
              _UserName = UserName;
              _PassWord = PassWord;
              _DomainName = DomainName;
          }
          public WindowsIdentity ImpersonationUser
          {
              get
              {
                  return null;  // not use ImpersonationUser
              }
          }
          public ICredentials NetworkCredentials
          {
              get
              {
                  // use NetworkCredentials
                  return new NetworkCredential(_UserName, _PassWord, _DomainName);
              }
          }
          public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)
          {
              // not use FormsCredentials unless you have implements a custom autentication.
              authCookie = null;
              user = password = authority = null;
              return false;
          }
      }
  </code></pre>
  
  <p>And while i am running this web-application in that case it will gives me an error i.e. 
  <img src="https://i.stack.imgur.com/lBLyZ.jpg" alt="enter image description here"></p>
  
  <p>Please help me out what will I do to resolve these all errors.....</p>