@Override public IWindowsAccount lookupAccount(final String username) { return new WindowsAccountImpl(username); }
node.appendChild(child); final String currentUsername = WindowsAccountImpl.getCurrentUsername(); this.addAccountInfo(doc, child, new WindowsAccountImpl(currentUsername));
clientContext.setPrincipalName(WindowsAccountImpl.getCurrentUsername()); clientContext.setCredentialsHandle(clientCredentials.getHandle()); clientContext.setSecurityPackage(securityPackage); clientContext.initialize(null, null, WindowsAccountImpl.getCurrentUsername()); log.debug("NTLM token is authenticated"); String resourceOwnerUserNameWithDomain = WindowsAccountImpl.getCurrentUsername(); String[] splitValues = resourceOwnerUserNameWithDomain.split("\\\\"); if (splitValues.length == 2) {
node.appendChild(child); final String currentUsername = WindowsAccountImpl.getCurrentUsername(); this.addAccountInfo(doc, child, new WindowsAccountImpl(currentUsername));
clientContext.setPrincipalName(WindowsAccountImpl.getCurrentUsername()); clientContext.setCredentialsHandle(clientCredentials.getHandle()); clientContext.setSecurityPackage(securityPackage); clientContext.initialize(null, null, WindowsAccountImpl.getCurrentUsername()); log.debug("NTLM token is authenticated"); String resourceOwnerUserNameWithDomain = WindowsAccountImpl.getCurrentUsername(); String resourceOwnerUserName = resourceOwnerUserNameWithDomain.split("\\\\")[1]; tokReqMsgCtx.setAuthorizedUser(OAuth2Util.getUserFromUserName(resourceOwnerUserName));
node.appendChild(child); final String currentUsername = WindowsAccountImpl.getCurrentUsername(); this.addAccountInfo(doc, child, new WindowsAccountImpl(currentUsername));
/** * Get the current Windows security context for a given SSPI package. * * @param securityPackage * SSPI package. * @param targetName * The target of the context. The string contents are security-package specific. * @return Windows security context. */ public static IWindowsSecurityContext getCurrent(final String securityPackage, final String targetName) { IWindowsCredentialsHandle credentialsHandle = WindowsCredentialsHandleImpl.getCurrent(securityPackage); credentialsHandle.initialize(); try { final WindowsSecurityContextImpl ctx = new WindowsSecurityContextImpl(); ctx.setPrincipalName(WindowsAccountImpl.getCurrentUsername()); ctx.setCredentialsHandle(credentialsHandle); ctx.setSecurityPackage(securityPackage); ctx.initialize(null, null, targetName); // Starting from here ctx 'owns' the credentials handle, so let's null out the // variable. This will prevent the finally block below from disposing it right away. credentialsHandle = null; return ctx; } finally { if (credentialsHandle != null) { credentialsHandle.dispose(); } } }
@Override public IWindowsAccount lookupAccount(final String username) { return new WindowsAccountImpl(username); }
/** * Get the current Windows security context for a given SSPI package. * * @param securityPackage * SSPI package. * @param targetName * The target of the context. The string contents are security-package specific. * @return Windows security context. */ public static IWindowsSecurityContext getCurrent(final String securityPackage, final String targetName) { IWindowsCredentialsHandle credentialsHandle = WindowsCredentialsHandleImpl.getCurrent(securityPackage); credentialsHandle.initialize(); try { final WindowsSecurityContextImpl ctx = new WindowsSecurityContextImpl(); ctx.setPrincipalName(WindowsAccountImpl.getCurrentUsername()); ctx.setCredentialsHandle(credentialsHandle); ctx.setSecurityPackage(securityPackage); ctx.initialize(null, null, targetName); // Starting from here ctx 'owns' the credentials handle, so let's null out the // variable. This will prevent the finally block below from disposing it right away. credentialsHandle = null; return ctx; } finally { if (credentialsHandle != null) { credentialsHandle.dispose(); } } }
@Override public IWindowsAccount lookupAccount(final String username) { return new WindowsAccountImpl(username); }
/** * Get the current Windows security context for a given SSPI package. * * @param securityPackage * SSPI package. * @param targetName * The target of the context. The string contents are security-package specific. * @return Windows security context. */ public static IWindowsSecurityContext getCurrent(final String securityPackage, final String targetName) { IWindowsCredentialsHandle credentialsHandle = WindowsCredentialsHandleImpl.getCurrent(securityPackage); credentialsHandle.initialize(); try { final WindowsSecurityContextImpl ctx = new WindowsSecurityContextImpl(); ctx.setPrincipalName(WindowsAccountImpl.getCurrentUsername()); ctx.setCredentialsHandle(credentialsHandle); ctx.setSecurityPackage(securityPackage); ctx.initialize(null, null, targetName); // Starting from here ctx 'owns' the credentials handle, so let's null out the // variable. This will prevent the finally block below from disposing it right away. credentialsHandle = null; return ctx; } finally { if (credentialsHandle != null) { credentialsHandle.dispose(); } } }
@Override public IWindowsAccount[] getGroups() { final Account[] groups = this.getUserGroups(); final List<IWindowsAccount> result = new ArrayList<>(groups.length); for (final Account userGroup : groups) { final WindowsAccountImpl account = new WindowsAccountImpl(userGroup); result.add(account); } return result.toArray(new IWindowsAccount[0]); }
@Override public IWindowsAccount[] getGroups() { final Account[] groups = this.getUserGroups(); final List<IWindowsAccount> result = new ArrayList<>(groups.length); for (final Account userGroup : groups) { final WindowsAccountImpl account = new WindowsAccountImpl(userGroup); result.add(account); } return result.toArray(new IWindowsAccount[0]); }
@Override public IWindowsAccount[] getGroups() { final Account[] groups = this.getUserGroups(); final List<IWindowsAccount> result = new ArrayList<>(groups.length); for (final Account userGroup : groups) { final WindowsAccountImpl account = new WindowsAccountImpl(userGroup); result.add(account); } return result.toArray(new IWindowsAccount[0]); }