@Override public IWindowsIdentity logonUser(final String username, final String password) { // username@domain UPN format is natively supported by the // Windows LogonUser API process domain\\username format final String[] userNameDomain = username.split("\\\\", 2); if (userNameDomain.length == 2) { return this.logonDomainUser(userNameDomain[1], userNameDomain[0], password); } return this.logonDomainUser(username, null, password); }
@Override public IWindowsIdentity logonDomainUser(final String username, final String domain, final String password) { return this.logonDomainUserEx(username, domain, password, WinBase.LOGON32_LOGON_NETWORK, WinBase.LOGON32_PROVIDER_DEFAULT); }
public boolean isValidUser(String username , String password){ WindowsAuthProviderImpl authenticationProvider = new WindowsAuthProviderImpl(); IWindowsIdentity loggedOnUser = authenticationProvider.logonUser(username, password); if(!loggedOnUser.isGuest()){ return true; } return false; }
WindowsAuthProviderImpl provider = new WindowsAuthProviderImpl(); IWindowsSecurityContext serverContext = null; serverContext = provider.acceptSecurityToken(clientContext.getToken(), "Negotiate");
serverContext = provider.acceptSecurityToken(SERVER_CONNECTION, bytesToken, SECURITY_PACKAGE); String type2Token = Base64.encode(serverContext.getToken()); if (log.isDebugEnabled()) { return false; } else if (tokenType == NTLM_TYPE_3_TOKEN) { serverContext = provider.acceptSecurityToken(SERVER_CONNECTION, bytesToken, SECURITY_PACKAGE); String resourceOwnerUserNameWithDomain = serverContext.getIdentity().getFqn(); String resourceOwnerUserName = resourceOwnerUserNameWithDomain.split("\\\\")[1];
serverContext = provider.acceptSecurityToken(SERVER_CONNECTION, bytesToken, SECURITY_PACKAGE); String type2Token = Base64.encode(serverContext.getToken()); if (log.isDebugEnabled()) { return false; } else if (tokenType == NTLM_TYPE_3_TOKEN) { serverContext = provider.acceptSecurityToken(SERVER_CONNECTION, bytesToken, SECURITY_PACKAGE); String resourceOwnerUserNameWithDomain = serverContext.getIdentity().getFqn(); String resourceOwnerUserName = resourceOwnerUserNameWithDomain.split("\\\\")[1];
/** * Instantiates a new negotiate authentication realm. */ public NegotiateAuthenticationRealm() { this.windowsAuthProvider = new WindowsAuthProviderImpl(); }
@Override public IWindowsIdentity logonUser(final String username, final String password) { // username@domain UPN format is natively supported by the // Windows LogonUser API process domain\\username format final String[] userNameDomain = username.split("\\\\", 2); if (userNameDomain.length == 2) { return this.logonDomainUser(userNameDomain[1], userNameDomain[0], password); } return this.logonDomainUser(username, null, password); }
@Override public IWindowsIdentity logonDomainUser(final String username, final String domain, final String password) { return this.logonDomainUserEx(username, domain, password, WinBase.LOGON32_LOGON_NETWORK, WinBase.LOGON32_PROVIDER_DEFAULT); }
/** * The {@link WindowsAuthProviderImpl} instance. * * @return the windows auth provider impl */ @Bean @ConditionalOnMissingBean public WindowsAuthProviderImpl waffleWindowsAuthProvider() { return new WindowsAuthProviderImpl(); }
@Override public IWindowsIdentity logonUser(final String username, final String password) { // username@domain UPN format is natively supported by the // Windows LogonUser API process domain\\username format final String[] userNameDomain = username.split("\\\\", 2); if (userNameDomain.length == 2) { return this.logonDomainUser(userNameDomain[1], userNameDomain[0], password); } return this.logonDomainUser(username, null, password); }
@Override public IWindowsIdentity logonDomainUser(final String username, final String domain, final String password) { return this.logonDomainUserEx(username, domain, password, WinBase.LOGON32_LOGON_NETWORK, WinBase.LOGON32_PROVIDER_DEFAULT); }
/** * Hook to the start and to set up the dependencies. * * @throws LifecycleException * the lifecycle exception */ @Override public void startInternal() throws LifecycleException { this.log.debug("Creating a windows authentication provider with continueContextsTimeout property set to: {}", this.continueContextsTimeout); this.auth = new WindowsAuthProviderImpl(this.continueContextsTimeout); super.startInternal(); }
/** * Hook to the start and to set up the dependencies. * * @throws LifecycleException * the lifecycle exception */ @Override public void startInternal() throws LifecycleException { this.log.debug("Creating a windows authentication provider with continueContextsTimeout property set to: {}", this.continueContextsTimeout); this.auth = new WindowsAuthProviderImpl(this.continueContextsTimeout); super.startInternal(); }
/** * Hook to the start and to set up the dependencies. * * @throws LifecycleException * the lifecycle exception */ @Override public void startInternal() throws LifecycleException { this.log.debug("Creating a windows authentication provider with continueContextsTimeout property set to: {}", this.continueContextsTimeout); this.auth = new WindowsAuthProviderImpl(this.continueContextsTimeout); super.startInternal(); }
/** * Hook to the start and to set up the dependencies. * * @throws LifecycleException * the lifecycle exception */ @Override protected synchronized void startInternal() throws LifecycleException { this.log.debug("Creating a windows authentication provider with continueContextsTimeout property set to: {}", this.continueContextsTimeout); this.auth = new WindowsAuthProviderImpl(this.continueContextsTimeout); super.startInternal(); }
/** * Hook to the start and to set up the dependencies. * * @throws LifecycleException * the lifecycle exception */ @Override protected synchronized void startInternal() throws LifecycleException { this.log.debug("Creating a windows authentication provider with continueContextsTimeout property set to: {}", this.continueContextsTimeout); this.auth = new WindowsAuthProviderImpl(this.continueContextsTimeout); super.startInternal(); }
/** * Hook to the start and to set up the dependencies. * * @throws LifecycleException * the lifecycle exception */ @Override protected synchronized void startInternal() throws LifecycleException { this.log.debug("Creating a windows authentication provider with continueContextsTimeout property set to: {}", this.continueContextsTimeout); this.auth = new WindowsAuthProviderImpl(this.continueContextsTimeout); super.startInternal(); }
/** * Hook to the start and to set up the dependencies. * * @throws LifecycleException * the lifecycle exception */ @Override protected synchronized void startInternal() throws LifecycleException { this.log.debug("Creating a windows authentication provider with continueContextsTimeout property set to: {}", this.continueContextsTimeout); this.auth = new WindowsAuthProviderImpl(this.continueContextsTimeout); super.startInternal(); }