Daniel Doubrovkine bio photo

Daniel Doubrovkine

aka dB., @awscloud, former CTO @artsy, +@vestris, NYC

Email Twitter LinkedIn Github Strava
Creative Commons License

A Waffle user is asking how to get the groups for a currently logged-in user. You don’t need Waffle to do this, just JNA. The 3.2.7 release has an Advapi32Util class that implements retrieving users from the current thread or process token.

for(Account a : Advapi32Util.getCurrentUserGroups()) {
  System.out.println(a.fqn);
}