|
Posted by Alun Jones on July 20, 2008, 2:24 am
If you were Registered and logged in, you could reply and use other advanced thread options
> Simple question, already searched but really nothing found.
>
> When I try to access a network resource - of a server I not yet have
> authenticated against - I get a Windows Credentials Prompt.
>
> I'm developing an .net application that needs to access a network
> share. Is there a .net or WinAPI call I can make that shows this
> Windows Credentials Prompt and gives me back a token so that I can
> Impersonate that User to access the network resource? Without this i
> get security exceptions and can not access files.
>
> Impersonation by using a Token through calling LogonUser API (with
> user password given) works. But i would prefer showing the Windows
> Prompt instead of doing a own user/pass prompt.
>
> And, is there an API to check if a token exists to access a server?
> (checking if it is necessary to show the prompt.)
CredUIPromptForWindowsCredentials should do the trick of getting you a
username and password back - I don't see a function that just returns a
token.
Alun.
~~~~
--
Texas Imperial Software | Web: http://www.wftpd.com/ 23921 57th Ave SE | Blog: http://msmvps.com/alunj/ Woodinville WA 98072-8661 | WFTPD, WFTPD Pro are Windows FTP servers.
Fax/Voice +1(425)807-1787 | Try our NEW client software, WFTPD Explorer.
|