Using LogonUser for authentication

D

Dan

We are writing a component that is supposed to
authenticate a user (using the user name, password and
domain) and then copy a file to a file share (using a
mapped drive or UNC path).

This component will be called from an IIS process (either
IIS 4, 5 or 6).

The general code structure is as follows:

Call RevertToSelf()
Call LogonUser() to obtain a token
Call ImpersonateLoggedOnUser()
Copy the file over
.....

Sounds pretty simple, right?

We have the most difficult time getting past LogonUser().
We invariably get an error 1314: "A required privilege is
not held by the client".

We get this error even though we attempt to run the
program as a standalone executable outside of IIS and
using Administrator user accounts.

One solution we saw was to provide "Act as part of the OS
privileges" to the user account in question. Even if this
works, we cannot do that for security reasons.

Does anyone have any idea what we could be doing wrong?

Thanks in advance for any assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top