Secur32#getUsernameEx does not return the Windows Account Name

230 views
Skip to first unread message

puperzenkarl

unread,
Sep 7, 2015, 5:05:11 AM9/7/15
to Java Native Access
I try to extract the account name of the logged in user via Secur32Util.getUserNameEx(Secur32.EXTENDED_NAME_FORMAT.NameUserPrincipal) (Standard Windows Domain).
On some workstations it returns a completely different account name. Looks like all these workstations have some common third party software installed (The returned account name equals the account name of the third party software).
Why?

Daniel Doubrovkine

unread,
Sep 7, 2015, 4:08:37 PM9/7/15
to jna-...@googlegroups.com
What's the application that's extracting the name? A web service? A desktop app?

--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

puperzenkarl .

unread,
Sep 8, 2015, 6:30:49 AM9/8/15
to jna-...@googlegroups.com
Eclipse RCP Application

--
You received this message because you are subscribed to a topic in the Google Groups "Java Native Access" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jna-users/oMXoshLZNEM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jna-users+...@googlegroups.com.

Daniel Doubrovkine

unread,
Sep 8, 2015, 2:55:05 PM9/8/15
to jna-...@googlegroups.com
So maybe the remote process runs under the credentials of the service user that's being returned? 

puperzenkarl

unread,
Sep 9, 2015, 7:16:25 AM9/9/15
to Java Native Access
There is no remote process. The client logs in to his Windows Workstation with his domain account, e.g. USR1234. Then he starts our Eclipse RCP application, which tries to detect the Windows Account via JNA. But the mentioned method call does not return USR1234, but instead returns the account name of some third party browser based application. How is this possible?

Daniel Doubrovkine

unread,
Sep 9, 2015, 10:46:18 AM9/9/15
to jna-...@googlegroups.com
I am going to say that it's not possible unless the Eclipse RCP application is executing via some kind of remote procedure. Usually Windows APIs don't lie, you're running the Java process under that account. The extension is likely inserting itself in in some weird way.

On Wed, Sep 9, 2015 at 7:16 AM, puperzenkarl <karl.p...@gmail.com> wrote:
There is no remote process. The client logs in to his Windows Workstation with his domain account, e.g. USR1234. Then he starts our Eclipse RCP application, which tries to detect the Windows Account via JNA. But the mentioned method call does not return USR1234, but instead returns the account name of some third party browser based application. How is this possible?

--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Doubrovkine

unread,
Sep 9, 2015, 10:46:32 AM9/9/15
to jna-...@googlegroups.com
I would be worried :)
Reply all
Reply to author
Forward
0 new messages