Querying logged on user's password

Hi all,

Is there any way [programmatically] to query and get the password of the
logged-on user ? I don’t want the user to enter the password by popping up a
dialog box. Basically the user credentials is needed to connect to the COM
Server which is running on a local host and remote host.

Thanks,
Sharoon

> dialog box. Basically the user credentials is needed to
connect to the COM

Server which is running on a local host and remote host.

COM will connect using the current-logged-on-NT-user by default.
If this fails, you can popup a UI username/password box and then
specify the credentials explicitly by CoSetProxyBlanket.

Max

Unfortunately if he logs in with a smart card or some other mechanism
that uses a custom GINA he may not have a password to enter. But as you
say as long as the server he’s trying to connect to will accent the
credentials of the currently logged-on user, this shouldn’t be
necessary.

  • Nicholas Ryan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim
S. Shatskih
Sent: Wednesday, March 26, 2003 7:22 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Querying logged on user’s password

> dialog box. Basically the user credentials is needed to
connect to the COM
> Server which is running on a local host and remote host.

COM will connect using the current-logged-on-NT-user by
default. If this fails, you can popup a UI username/password
box and then specify the credentials explicitly by CoSetProxyBlanket.

Max


You are currently subscribed to ntdev as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Accept for accent - what the heck was I typing…

  • Nicholas Ryan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nicholas Ryan
Sent: Wednesday, March 26, 2003 11:50 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Querying logged on user’s password

Unfortunately if he logs in with a smart card or some other
mechanism that uses a custom GINA he may not have a password
to enter. But as you say as long as the server he’s trying to
connect to will accent the credentials of the currently
logged-on user, this shouldn’t be necessary.

  • Nicholas Ryan

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
> Shatskih
> Sent: Wednesday, March 26, 2003 7:22 AM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Querying logged on user’s password
>
>
> > dialog box. Basically the user credentials is needed to
> connect to the COM
> > Server which is running on a local host and remote host.
>
> COM will connect using the current-logged-on-NT-user by default. If
> this fails, you can popup a UI username/password box and
then specify
> the credentials explicitly by CoSetProxyBlanket.
>
> Max
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@nryan.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

You use the default mechanism for connecting. Usually there is no need of
such an item, you just have to validate the user and not the password!

Now just for your curiosity, in which OS? In 98 DDK, there is an API [Of
course not with documented support] GetCachedPassword or so, you just give a
smart grep in 98 DDK. If you are in NT world, no such straight forward way.
Winlogon caches the same, Add debug privilege to your app, which is needed
for peeking Winlogon. Search the memory block containing the pwd in WL’s
memory space. Get the pwd and decode it. Use RtlRunDecodeUnicodeString from
ntdll.dll.

Much structs/fxns/examples from prasad dabak’s book and I tested only in
some versions :wink:

Govind
www.nesttech.com

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Wednesday, March 26, 2003 8:52 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Querying logged on user’s password

dialog box. Basically the user credentials is needed to
connect to the COM
Server which is running on a local host and remote host.

COM will connect using the current-logged-on-NT-user by default.
If this fails, you can popup a UI username/password box and then
specify the credentials explicitly by CoSetProxyBlanket.

Max


You are currently subscribed to ntdev as: xxxxx@nestec.net
To unsubscribe send a blank email to xxxxx@lists.osr.com