Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 3.43 KB

File metadata and controls

56 lines (44 loc) · 3.43 KB
title Web Service Authentication
description If your client makes SOAP requests to a report server, implement the client portion of authentication. Learn to implement authentication for a Web service.
ms.date 09/25/2024
ms.service reporting-services
ms.subservice report-server-web-service
ms.topic reference
ms.custom
updatefrequency5
helpviewer_keywords
Web service [Reporting Services], authentication
XML Web service [Reporting Services], authentication
Report Server Web service, authentication

Web Service Authentication

You can use either Windows Authentication or Basic authentication to authenticate the calls made to the Report Server Web service. Any client that makes SOAP requests to the report server must implement the client portion of one of the supported authentication protocols. If you are using the [!INCLUDEmsCoName] [!INCLUDEdnprdnshort], you can use the managed code HTTP classes to implement authentication. Using these APIs makes it easy to send authentication information along with the SOAP requests.

If you do not have appropriate credentials before you make a call to the Report Server Web service, the call fails. At run time, you can pass credentials to the Web service by setting the Credentials property of the client-side object that represents the Web service before you call its methods.

The following sections contain example code that sends credentials using the [!INCLUDEdnprdnshort].

Windows Authentication

The following code passes Windows credentials to the Web service.

Dim rs As New ReportingService()  
rs.Credentials = System.Net.CredentialCache.DefaultCredentials  
ReportingService rs = new ReportingService();  
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  

Basic Authentication

The following code passes Basic credentials to the Web service.

Dim rs As New ReportingService()  
rs.Credentials = New System.Net.NetworkCredential("username", "password", "domain")  
ReportingService service = new ReportingService();  
service.Credentials = new System.Net.NetworkCredential("username", "password", "domain");  

The credentials must be set before you call any of the methods of the Report Server Web service. If you do not set the credentials, you receive the error code an HTTP 401 Error: Access Denied. You must authenticate the service before you use it, but after you have set the credentials, you do not need to set them again as long as you continue to use the same service variable (such as rs).

Custom Authentication

[!INCLUDEssRSnoversion] includes a programming API that provides developers with the opportunity to design and develop custom authentication extensions, known as security extensions. For more information, see Implementing a Security Extension.

Related content