Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Security (http://www.velocityreviews.com/forums/f62-asp-net-security.html)
-   -   Routing Userrights to another ASP.Net Webapplication (http://www.velocityreviews.com/forums/t769937-routing-userrights-to-another-asp-net-webapplication.html)

T. Beneke 08-25-2008 01:11 PM

Routing Userrights to another ASP.Net Webapplication
 
I've got a ASP.Net Application, whos running on an IIS with integrated
security. This Application offers a download for documents who are not
hosted in the ASP.Net Application. It's hosted on a several SharePoint
Server and all servers are in the same domain. A User has access to both of
the Server.
I want to handle a request from the ASP.Net Application to the SharePoint
with the userrights (usercredential) of the current user.

Here is a samplesourcecode to explain:

Dim WC As New System.Net.WebClient
....
'WC.Credentials = CredentialCache.DefaultCredentials ' doesn't work
'WC.Credentials = CredentialCache.DefaultNetworkCredentials 'doesn't work
WC.Creddentials = New Net.NetworkCredential("mr.x", "password", "domain...")
' works fine!!! but in the current context I've got no password
Return WC.DownloadData("http://sampleserver/subdir/sample.pdf")
....

i need something like:
WC.Credentials = HttpContext.Current.User.Credentials 'this is only an
example it dosn't exist

Has anybody an idea?

Thanks
Thomas


Joe Kaplan 08-25-2008 01:18 PM

Re: Routing Userrights to another ASP.Net Webapplication
 
In order to make this type of scenario work, you need to implement Kerberos
delegation. If you are able to do that, then DefaultCredentials will work
ok.

Kerberos delegation can be a challenge to set up, but there are many
documents from Microsoft that explain how.

You probably won't change anything from a coding perspective. It is mostly
an act of configuration.

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"T. Beneke" <t.beneke@moehlenhoff.de> wrote in message
news:ejqAYQrBJHA.3512@TK2MSFTNGP05.phx.gbl...
> I've got a ASP.Net Application, whos running on an IIS with integrated
> security. This Application offers a download for documents who are not
> hosted in the ASP.Net Application. It's hosted on a several SharePoint
> Server and all servers are in the same domain. A User has access to both
> of the Server.
> I want to handle a request from the ASP.Net Application to the SharePoint
> with the userrights (usercredential) of the current user.
>
> Here is a samplesourcecode to explain:
>
> Dim WC As New System.Net.WebClient
> ...
> 'WC.Credentials = CredentialCache.DefaultCredentials ' doesn't work
> 'WC.Credentials = CredentialCache.DefaultNetworkCredentials 'doesn't work
> WC.Creddentials = New Net.NetworkCredential("mr.x", "password",
> "domain...") ' works fine!!! but in the current context I've got no
> password
> Return WC.DownloadData("http://sampleserver/subdir/sample.pdf")
> ...
>
> i need something like:
> WC.Credentials = HttpContext.Current.User.Credentials 'this is only an
> example it dosn't exist
>
> Has anybody an idea?
>
> Thanks
> Thomas





All times are GMT. The time now is 02:37 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.