Home All Groups Group Topic Archive Search About

Is Delegation Necessary?

Author
8 Jul 2009 7:42 PM
headware
My ASP.NET app needs to access an Excel file sitting on another
computer on a the network using ADO.NET. I've tried this using just
impersonation and it seems to work fine but everything I read says
that accessing network resources requires delegation. Is that
necessary in this case? If so, why is this working?

Thanks,
Dave

Author
8 Jul 2009 7:56 PM
Mark Rae [MVP]
"headware" <david.k.l***@gmail.com> wrote in message
news:cca35402-9116-4233-994f-db64e10bed00@x6g2000prc.googlegroups.com...

> Is that necessary in this case?

No.


> If so, why is this working?

Because it's not necessary in this case...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Are all your drivers up to date? click for free checkup

Author
8 Jul 2009 8:51 PM
headware
Show quote Hide quote
On Jul 8, 2:56 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote:
> "headware" <david.k.l***@gmail.com> wrote in message
>
> news:cca35402-9116-4233-994f-db64e10bed00@x6g2000prc.googlegroups.com...
>
> > Is that necessary in this case?
>
> No.
>
> > If so, why is this working?
>
> Because it's not necessary in this case...
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

Would you please explain why it's not required in this case?
Author
8 Jul 2009 10:30 PM
Mark Rae [MVP]
"headware" <david.k.l***@gmail.com> wrote in message
news:56df8081-c783-4d30-b675-4b3c995e5af7@y28g2000prd.googlegroups.com...

>>> If so, why is this working?
>>
>> Because it's not necessary in this case...
>>
> Would you please explain why it's not required in this case?

I'm not quite sure how to answer your question - it's not required because
it's not required, in the same way that it's not required to use a web
service, or AJAX, or remoting, or <insert any particular technology you
like> to query an Excel file with ADO.NET.

Perhaps it might be simpler if you explain why you think it should be
required...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Author
9 Jul 2009 4:39 AM
headware
Show quote Hide quote
On Jul 8, 5:30 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote:
> "headware" <david.k.l***@gmail.com> wrote in message
>
> news:56df8081-c783-4d30-b675-4b3c995e5af7@y28g2000prd.googlegroups.com...
>
> >>> If so, why is this working?
>
> >> Because it's not necessary in this case...
>
> > Would you please explain why it's not required in this case?
>
> I'm not quite sure how to answer your question - it's not required because
> it's not required, in the same way that it's not required to use a web
> service, or AJAX, or remoting, or <insert any particular technology you
> like> to query an Excel file with ADO.NET.
>
> Perhaps it might be simpler if you explain why you think it should be
> required...?
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

Well, I've read in several places that it's required in order to
access network resources. Here are some examples:

From Microsoft:
http://msdn.microsoft.com/en-us/library/ms998351.aspx
"you can use impersonation to access local resources . . . Delegation
allows you to use an impersonation token to access network resources."

Non-Microsoft:
http://www.infosysblogs.com/microsoft/2009/02/impersonation_and_delegation_t.html
"In summary, impersonation is pretending to be someone else, other
than the process identity, and access local resources . . . delegation
is authentication across machine boundary on behalf of someone else."

I don't have a lot of experience with impersonation and delegation so
it's entirely possible that I'm misunderstanding this. If that's the
case, maybe you could give me an example of when it would be necessary
to use delegation and why impersonation wouldn't be sufficient.

Thanks,
Dave
Author
9 Jul 2009 9:51 AM
Mark Rae [MVP]
"headware" <david.k.l***@gmail.com> wrote in message
news:e8092b00-3a3e-45aa-8c84-cd5b18d5b2f4@b14g2000yqd.googlegroups.com...

>> Perhaps it might be simpler if you explain why you think it should be
>> required...?
>
> Well, I've read in several places that it's required in order to
> access network resources. Here are some examples:
>
> From Microsoft:
> http://msdn.microsoft.com/en-us/library/ms998351.aspx
> "you can use impersonation to access local resources . . . Delegation
> allows you to use an impersonation token to access network resources."

That article says that you *CAN* use impersonation to access local
resources - it doesn't say that you *HAVE TO*...

It further says that delegation allows you to use an impersonation token to
access network resources - IF YOU NEED ONE! In your case, you clearly
don't...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Author
9 Jul 2009 3:25 PM
headware
Show quote Hide quote
On Jul 9, 4:51 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote:
> "headware" <david.k.l***@gmail.com> wrote in message
>
> news:e8092b00-3a3e-45aa-8c84-cd5b18d5b2f4@b14g2000yqd.googlegroups.com...
>
> >> Perhaps it might be simpler if you explain why you think it should be
> >> required...?
>
> > Well, I've read in several places that it's required in order to
> > access network resources. Here are some examples:
>
> > From Microsoft:
> >http://msdn.microsoft.com/en-us/library/ms998351.aspx
> > "you can use impersonation to access local resources . . . Delegation
> > allows you to use an impersonation token to access network resources."
>
> That article says that you *CAN* use impersonation to access local
> resources - it doesn't say that you *HAVE TO*...
>
> It further says that delegation allows you to use an impersonation token to
> access network resources - IF YOU NEED ONE! In your case, you clearly
> don't...
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

I'm trying to access a file on another computer over the network. You
don't consider that a network resource? Maybe this is a just a
definition issue.

I realize that impersonation and delegation are not required in every
situation, but there are cases where they are. Maybe if you gave an
example of a situation where delegation would be required and why, it
would help explain things better.
Author
9 Jul 2009 4:01 PM
Mark Rae [MVP]
"headware" <david.k.l***@gmail.com> wrote in message
news:1a00ca45-4385-4456-a3f2-38597f1849f5@18g2000yqa.googlegroups.com...

> I'm trying to access a file on another computer over the network. You
> don't consider that a network resource? Maybe this is a just a
> definition issue.

Yes, it is a network resource, but it involves only two machines - the
machine that the browser is running on, and the webserver.

> I realize that impersonation and delegation are not required in every
> situation, but there are cases where they are. Maybe if you gave an
> example of a situation where delegation would be required and why, it
> would help explain things better.

If a third machine were involved, then this would require delegation. The
first computer connects to the second computer via a standard network
connection - this doesn't require delegation. However, if the second
computer then tries to connect to a third computer using the credentials by
which the first computer accessed the second computer, then this would
require delegation because the third computer would need to trust the second
computer's authentication of the first computer.


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Author
9 Jul 2009 12:01 PM
Larry Smith
As an FYI, these issues really have nothing to do with ASP.NET whatsoever.
It's the Windows security model that's in control. If you understand how
that works, everything will be easily understood. The devil's in the details
of course but it's not nearly as complicated as people think. The real
problem is that there's virtually no documenation from MSFT that *clearly*
explains how this model works. Instead, get yourself the book "Programming
Windows Security" by Keith Brown. It was published many years ago but still
the most relevant book on the subject I've ever seen (and still applicable
to all professional versions of MSFT OSs). Spend the time to get through it
and you'll be glad you did. It will forever eliminate your security
problems.
Author
10 Jul 2009 3:08 AM
headware
On Jul 9, 7:01 am, "Larry Smith" <_nospam@_no_spam.com> wrote:
> As an FYI, these issues really have nothing to do with ASP.NET whatsoever..
> It's the Windows security model that's in control. If you understand how
> that works, everything will be easily understood. The devil's in the details
> of course but it's not nearly as complicated as people think. The real
> problem is that there's virtually no documenation from MSFT that *clearly*
> explains how this model works. Instead, get yourself the book "Programming
> Windows Security" by Keith Brown. It was published many years ago but still
> the most relevant book on the subject I've ever seen (and still applicable
> to all professional versions of MSFT OSs). Spend the time to get through it
> and you'll be glad you did. It will forever eliminate your security
> problems.

Thanks for the reference. Reading the topic list, it does cover a lot
of the things I'm interested in. Good cover art too. I found another
one called "The .NET Developer's Guide to Windows Security" that might
be worth a look as well. I really don't want to be a Windows admin but
this stuff does come up quite a bit especially with web apps. A
developer focused book would be ideal.
Author
8 Jul 2009 8:25 PM
Gregory A. Beamer
headware <david.k.l***@gmail.com> wrote in news:cca35402-9116-4233-994f-
db64e10be***@x6g2000prc.googlegroups.com:

> My ASP.NET app needs to access an Excel file sitting on another
> computer on a the network using ADO.NET. I've tried this using just
> impersonation and it seems to work fine but everything I read says
> that accessing network resources requires delegation. Is that
> necessary in this case? If so, why is this working?
>
> Thanks,
> Dave

FYI: There is a certain amount of "delegation" involved in impersonation,
although it is under the hood. ;-)

BTW, is this drive mapped or are you using a UNC path? Just curious.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
Show quoteHide quote
|      Think outside the box!             |
*******************************************
Author
8 Jul 2009 8:50 PM
headware
On Jul 8, 3:25 pm, "Gregory A. Beamer"
<NoSpamMgbwo...@comcast.netNoSpamM> wrote:
Show quoteHide quote
> headware <david.k.l***@gmail.com> wrote in news:cca35402-9116-4233-994f-
> db64e10be***@x6g2000prc.googlegroups.com:
>
> > My ASP.NET app needs to access an Excel file sitting on another
> > computer on a the network using ADO.NET. I've tried this using just
> > impersonation and it seems to work fine but everything I read says
> > that accessing network resources requires delegation. Is that
> > necessary in this case? If so, why is this working?
>
> > Thanks,
> > Dave
>
> FYI: There is a certain amount of "delegation" involved in impersonation,
> although it is under the hood. ;-)
>
> BTW, is this drive mapped or are you using a UNC path? Just curious.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> Twitter: @gbworld
> Blog:http://gregorybeamer.spaces.live.com
>
> *******************************************
> |      Think outside the box!             |
> *******************************************

It's a UNC path to a share on another box.
Author
8 Jul 2009 9:05 PM
Gregory A. Beamer
headware <david.k.l***@gmail.com> wrote in
news:5c2c9455-8315-40fd-a05d-05db33c0ba87@j9g2000prh.googlegroups.com:

>
> It's a UNC path to a share on another box.
>

If it is working, I would roll with it. It is not the "best" solution, but
I have read nothing that convinces me it is a horrible option that you
should not use.

Note, however, if the network admins lock down security, it could fail.
This is a risk with any external resource you are linked to, UNC or mapped.



--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
Show quoteHide quote
|      Think outside the box!             |
*******************************************
Author
9 Jul 2009 2:03 AM
Larry Smith
> My ASP.NET app needs to access an Excel file sitting on another
> computer on a the network using ADO.NET. I've tried this using just
> impersonation and it seems to work fine but everything I read says
> that accessing network resources requires delegation. Is that
> necessary in this case?

No

>  If so, why is this working?

It's working because delegation means allowing the *remote* machine to
access network resources. You can access the remote machine with your Excel
file IOW (which involves its own authentication - long story) but that
machine can't turn around and access another machine unless you permitted
delegation in the first place (which is potentially very dangerous since the
remote machine then has your network credentials and can masquerade as you
on another machine which can do the same and so forth - each new machine
thinks it's you and so can cause damage in *your* name - your credentials
are also spread across all these machines - not good).
Author
9 Jul 2009 1:48 PM
bruce barker
with only two computers delegation is not required. its required when
you involve 3. a sends its credentials to b, and b tries to use these
credentials to access c. this is because c, has to trust b's
authentication of a.

as long as the web browser used in on the same computer as the web
server, no delegation (which requires kerberos) is needed. if you hit
your website from another computer, then delegtion will be required.

-- bruce (sqlwork.com)

headware wrote:
Show quoteHide quote
> My ASP.NET app needs to access an Excel file sitting on another
> computer on a the network using ADO.NET. I've tried this using just
> impersonation and it seems to work fine but everything I read says
> that accessing network resources requires delegation. Is that
> necessary in this case? If so, why is this working?
>
> Thanks,
> Dave

Bookmark and Share