By default, every call to Reporting Services must be an authenticated call. To provide credentials to authenticate, you must use the Credentials property of the web service proxy class. Take the following example, which tries to...
See more »
By default, every call to Reporting Services must be an authenticated call. To provide credentials to authenticate, you must use the Credentials property of the web service proxy class. Take the following example, which tries to retrieve a list of delivery extensions from the server: ReportingService rs = new ReportingService(); rs.Credentials = System.Net.CredentialCache.DefaultCredentials; Extension[] extensions = rs.ListExtensions(ExtensionTypeEnum.Delivery); The DefaultCredentials property represents the credentials for the current security context of the process. For a client-side application, like a Windows Form application or a console mode program, the credentials will be the credentials of the user executing the program. If you are receiving the “permissions are insufficient” exception with this code in a client application, the user is authenticated but not in a reporting services role with authorization to complete the task. See the later section on role-based security. If you are seeing an access denied error message from a client application then the report server cannot authenticate the client. Perhaps the report server is not in the same domain as the user’s machine. In this scenario there are at least two options available. First, you could create a ‘shadow account’ on the reporting server by duplicating the user’s domain login and password on the report server. Creating a shadow account can be hard to maintain, particularly if a password change policy is in effect for the domain, because the passwords must remain synchronized. Alternatively, you can pass credentials for an account that exists on the report server using the NetworkCredential class: ReportingService rs = new ReportingService(); rs.Credentials = new NetworkCredential(username, password, domain); Extension[] extensions = rs.ListExtensions(ExtensionTypeEnum.Delivery); Obviously, you need to take extreme care in where and how you store the username and password on a client machine. Hard coding the values into the program as we do above is inflexible and vulnerable to a disassembler. Storing the values in a configuration file in plaintext is even more vulnerable. My suggestion is to use Microsoft's data protection API (DPAPI) to keep the values encrypted. Credentials and ASP.NET Determing what DefaultCredentials represents in an ASP.NET environment is more difficult. In a default installation, with no impersonation in place, DefaultCredentials will be the credentials for the ASP.NET process. The ASP.NET process runs as the ASPNET account (in IIS 5.0), or the NETWORK SERVICE account (in IIS 6.0). At this point we need to break down the scenario into local reporting server versus remote reporting server environments.
See less »
Kaboodle will send you a newsletter and updates from your friends. You can unsubscribe at any time. Kaboodle does not sell or share your email address or personal information with anyone.
Kaboodle requires all users to provide their real date of birth as both a safety precaution and as a means
of preserving the integrity of the site. You will be able to hide this information from your profile if you wish.
Added by 1 people