Forms Authentication - Reporting Services Web Service integration

From: Paul Keegstra (PaulKeegstra_at_discussions.microsoft.com)
Date: 12/28/04


Date: Tue, 28 Dec 2004 08:01:05 -0800

I am working on an asp.net application which requires forms authentication as
the method for authenticating the web application using the underlying Active
Directory as the user store.

I have created my Forms Authentication process using the methods described
in some MSDN samples and that works just great.

The question/issue I have is this process results in the creation of a forms
authentication ticket and setting of the Context.User to a GenericPricipal
object. Now, another part of the application needs to run reports that are
defined in SQL Server Reporting Services by integrating the solution via the
reporting services web service (vs. a URL link).

In my code to invoke the web service, I have to set the credentials on the
reporting services web service object to something other than
system.net.credentialcache.defaultcredentials or I end up with the
credentials from the aspnet service account. I've tried setting <identity
impersonate="true" /> in my web.config but that didn't do it. I can get it
working if I set my credentials to a new instance of the network credentials
class:

rs.credentials = new
system.net.NetworkCredentials("username","password","domain").

Unfortunately, I can only seem to make this work by hardcoding the username,
password, and domain.

Is there any way to map a GenericPrincipal instance's properties to create a
valid NetworkCredentials instance? That seems to be the solution I need, but
I can't retrieve the password from the GenericPrincipal nor can I get it from
the FormsAuthenticationTicket (unless you have some suggestion in that
regard).

I would appreciate any suggestions.

-- 
Paul


Relevant Pages

  • Re: Default credentials
    ... > comes up on my client site requires NTLM or Basic authentication? ... > a web browser - I assume it must be something they have set up ... If your receive a Dialog asking for your creds with NTLM auth ... credentials of the current security context. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Default credentials
    ... > comes up on my client site requires NTLM or Basic authentication? ... > a web browser - I assume it must be something they have set up ... If your receive a Dialog asking for your creds with NTLM auth ... credentials of the current security context. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Default credentials
    ... > comes up on my client site requires NTLM or Basic authentication? ... > a web browser - I assume it must be something they have set up ... If your receive a Dialog asking for your creds with NTLM auth ... credentials of the current security context. ...
    (microsoft.public.dotnet.security)
  • Re: IIS6 - Integrated Authentication Probs
    ... When you use Basic authentication, ... outlined in Chapter 5 of the IIS 6 Resource Kit: ... > b) - Despite the fact these credentials are being parsed, ... > Hence - this is a general problem with the way the web server is using my ...
    (microsoft.public.inetserver.iis.security)
  • Re: Cached Logon
    ... > current credentials and only after failing would prompt for credentials. ... Keep in mind that whether the IE browser will supply the Windows ... the scenes" windows authentication information? ... > On the server I was logged in as domain1\administrator. ...
    (microsoft.public.windows.server.general)