Re: how to pass nt password ?



"James" <jkklim@xxxxxxxxxxx> wrote in message news:eqL%23lpz6FHA.1416@xxxxxxxxxxxxxxxxxxxxxxx
>I succesfully pass username , domain and password via this function (taken from MSDN)
>
> Private Declare Auto Function LogonUser Lib "advapi32.dll" (ByVal lpszUsername As [String], _
>
> ByVal lpszDomain As [String], ByVal lpszPassword As [String], _
>
> ByVal dwLogonType As Integer, ByVal dwLogonProvider As Integer, _
>
> ByRef phToken As IntPtr) As Boolean
>
> Dim returnValue As Boolean = LogonUser(username, domain, pwd, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,
> tokenHandle)
>
> The above assumes that in the application, user will be required to enter username, domain and password via keyboard
>
> However i do NOT want the application to ASK user for the username,domain and password. Instead the application shld
> use the current user context since users already logon to a operating system eg XP.
>
> i can extract username and domain using the WindowsIdentity.Name Property which give it as domain\nt id, and then i
> pass to above function in username, domain.
>
> How do i extract password ? I know password cannot be seen, but at least what can i do to pass the current password
> arguments into the above function - logonuser ?

The user is already logged on, so why would you want them to logon to
your program using the self same credentials? Your program should
simply run in user context (indeed, it should be tested on an account
with the minimum credentials required to operate). If your program
requires elevated privileges then the USER must provide the required
credentials, NOT your program. Bypassing the built-in security (such
as it is) is not an option if you want your application to remain compliant.


.



Relevant Pages

  • RE: Help Needed configuring Samba on Webserver
    ... username and password, and it reported successfully joining the domain ... Passwd: files windbind ... I logged in as the jkocher user on a windows xp pro station that is part ... Supplying the credentials for jkocher (the logged in ...
    (Fedora)
  • Re: Connecting to a File Server
    ... to retreive a password and username saved in the credential manager? ... Using 4.2 we were able to save the credentials and then pass 0 to username ... BOOL SaveDefaultCredentials(TCHAR *szUser, TCHAR *szPassword, TCHAR ... BOOL RetValue = FALSE; ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Stange access problem
    ... Merv Porter [SBS-MVP] ... "Windows cannot bind to local domain (invalid credentials)" ... logging on with his correct username and password. ... One oddity is the username that pops up is not his 'domain/username'. ...
    (microsoft.public.backoffice.smallbiz)
  • Re: Stange access problem
    ... "Windows cannot bind to local domain (invalid credentials)" ... network resource accesses are requiring his credentials. ... on with his correct username and password. ... One oddity is the username that pops up is not his 'domain/username'. ...
    (microsoft.public.backoffice.smallbiz)
  • Re: POP through ISA
    ... This may be a problem with the authenication. ... If your mailbox alias is ... then you need to enter the username ... E-mail alias is Jim.McBee, my credentials for ...
    (microsoft.public.exchange.admin)

Loading