Re: Calling NetUserGetInfo from ASP.NET app
- From: "Joe Kaplan \(MVP - ADSI\)" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 May 2006 10:40:03 -0500
The LogonUser thing isn't delegation, since that's a local logon, but that
is a way to get it working if you have plaintext credentials.
There is a feature in Windows 2003 (with Windows 2003 AD) called protocol
transition (S4U) that you could use as well. PT allows non-Kerberos
authentication on the front end (like basic, NTLM or Digest) and will
"transition" to Kerberos when Kerberos auth is needed. PT can also be
called programmatically by your code. Essentially, you can call
LsaLogonUser with the proper arguments, or in .NET, you can use the
WindowsIdentity constructor that simply takes a UPN as the argument. That
will give you a Windows user token/WindowsIdentity that you can impersonate
and use for remote calls, assuming that the account has the correct rights
for delegation with any protocol and can delegate to the services you need
to visit.
If you are going to have plaintext credentials, then this isn't really
necessary, but it is an option.
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
--
"Michael D'Angelo" <nospamnmdange@xxxxxxxxxxxxxxx> wrote in message
news:eWFC2PMgGHA.4892@xxxxxxxxxxxxxxxxxxxxxxx
nah I did get it working.
I can query AD using the LDAP provider just fine. As I said, I cheated by
calling LogonUser, DuplicateToken, and ImpersonateLoggenOnUser ;)
It's only NetUserGetInfo that fails, and I narrowed it down to a
permission issue, because it works when the user is in the Pre-Windows
2000 Compatible group.
I do it in Global.asax in the PreRequestHandlerExecute event, then call
RevertToSelf in PostRequestHandlerExecute. Seems to do the job. I cas
share the code if you like :)
The main thing is that I needed it to work even with non-IE browsers, and
through a firewall. Two things it doesn't seem regular Kerberos-based
delegation work with...
"Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx> wrote
in message news:%23iJCMhIgGHA.4976@xxxxxxxxxxxxxxxxxxxxxxx
Good deal. It uses the LSA to do the work for you using the machine's
credentials, so you don't necessarily need to do an RPC on the client's
behalf. It is probably a lot easier than getting delegation working and
I think the LSA also provides some built in caching for you. Of course,
the next time you really do need delegation, you still won't know how to
get it working. :)
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
--
"Michael D'Angelo" <nospamnmdange@xxxxxxxxxxxxxxx> wrote in message
news:%23oOJcZHgGHA.1856@xxxxxxxxxxxxxxxxxxxxxxx
Finally! I got it to work by using TranslateName. Go figure.
Thanks for mentioning it though, I didn't know about that api :)
.
- References:
- Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Joe Kaplan \(MVP - ADSI\)
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Joe Kaplan \(MVP - ADSI\)
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Joe Kaplan \(MVP - ADSI\)
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Joe Kaplan \(MVP - ADSI\)
- Re: Calling NetUserGetInfo from ASP.NET app
- From: Michael D'Angelo
- Calling NetUserGetInfo from ASP.NET app
- Prev by Date: Re: host a windows user control File access
- Next by Date: Retrive Autogenerated machinekey
- Previous by thread: Re: Calling NetUserGetInfo from ASP.NET app
- Next by thread: URL Authorization does not override File Authorization?
- Index(es):
Relevant Pages
|