RSS

The request failed with HTTP status 401: Unauthorized. Reporting Service ReportViewer (SharePoint Web Part)

15 Mar

I tried to use Reporting service Report Viewer that connect to Report Server remottly in custom web part in SharePoint.

It’s deployed successfully but when tried to show report it’s give me the following errorerror1

I tried to create test ASP.Net Web Site solution with the same code  and my surprise it’s worked successfully  but in web part not worked :(

I decided to check Authentication of SharePoint Site Start–> Administrative Tools –> IIS Manager then navigate to my SharePoint site then select Authentication .

IIS

At ASP.Net Impersonate it’s Enabled

IIS2

When I set Asp.Net Impersonate to false it’s worked successfully :)

Unfortunately Over two hour I tried to use Search but not worked i try to run full crawl search from central administration but also not worked :(

I decided to check Crawl Log and found the following error

error hresult fail has been returned from a call to a com component

SearchCrawl

I ask my self what’s the changes i do and went back to Enable  Asp.Net Impersonate , and tried to run Full Crawl search and the error disappeared and search Work Successfully

but the main error back again :)

The request failed with HTTP status 401: Unauthorized.

I decided to disable Asp.Net Impersonate at the moment that I show my report So i will disable it via the following code in my web part

public System.Security.Principal.WindowsImpersonationContext impersonationContext;

impersonationContext = System.Security.Principal.WindowsIdentity.Impersonate(System.IntPtr.Zero);

//Insert your code that runs under the security context of the authenticating user here.

impersonationContext.Undo();

Good Luck :)

About these ads
 

Tags: , , , , , ,

6 responses to “The request failed with HTTP status 401: Unauthorized. Reporting Service ReportViewer (SharePoint Web Part)

  1. Ryan klick

    March 16, 2013 at 12:54 pm

    This isn’t a proper fix, in fact its more of a hack. Your having obvious issues with your authentication configuration on the server (are you using Kerberos? if so are all your spn’s setup correctly ) or potentially this is caused by incorrect formatting on the report URL. can you post your configuration of the report URL / location in the report viewer webpart.

     
  2. Ryan klick

    March 16, 2013 at 12:58 pm

    This isn’t a proper fix, in fact its more of a hack. Your having obvious issues with your authentication configuration on the server (are you using Kerberos? if so are all your spn’s setup correctly ) or potentially this is caused by incorrect formatting on the report URL. can you post your configuration of the report URL / location in the report viewer webpart. …

     
    • Ryan klick

      March 16, 2013 at 1:02 pm

      This isn’t a proper fix, in fact its more of a hack. Your having obvious issues with your authentication configuration on the server (are you using Kerberos? if so are all your spn’s setup correctly ) or potentially this is caused by incorrect formatting on the report URL. can you post your configuration of the report URL / location in the report viewer webpart. …

       
      • Mohammed Kamal El Kassas

        May 23, 2013 at 2:18 pm

        No i am not using Kerberos and this method worked successfully with me :) any way thanks for your comment and i welcome with any solution from you

         
  3. mohamed rabie

    March 17, 2013 at 6:49 am

    Hi , this error cause of security validation for other tiers in sharepoint, you need to stop page security validation , or add security digest control in the master page .

     
  4. mature women sexy

    August 5, 2013 at 6:46 pm

    If some one wants expert view concerning blogging and site-building
    afterward i suggest him/her to go to see this weblog, Keep
    up the fastidious work.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: