Request user name auth

@param userName userName to authenticate
@return Command for execution
761274
@NotNull
    @ObjectiveCName("requestStartAuthCommandWithUserName:")
    public Command<AuthState> requestStartUserNameAuth(String userName) {
        return modules.getAuthModule().requestStartUserNameAuth(userName);
    }
225885
public T authentication(String username, String password) {
        return authentication(username, password, false);
    }
811293
@GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/username/{username}")
    @Description("Returns the user having the given username.")
    public PrincipalUserDto getUserByUsername(@Context HttpServletRequest req,
        @PathParam("username") final String userName) {

        Enumeration<String> headerNames = req.getHeaderNames();
        while(headerNames.hasMoreElements()) {
            String headerName = headerNames.nextElement();
            String headerValue = req.getHeader(headerName);
            System.out.println(headerName + ": " + headerValue);
        }

        if (userName == null || userName.isEmpty()) {
            throw new WebApplicationException("Username cannot be null or empty.", Status.BAD_REQUEST);
        }

        PrincipalUser remoteUser = validateAndGetOwner(req, null);
        PrincipalUser user = _uService.findUserByUsername(userName);

        if (user != null) {
            super.validateResourceAuthorization(req, user, remoteUser);
            return PrincipalUserDto.transformToDto(user);
        } else if (!remoteUser.isPrivileged()) {
            throw new WebApplicationException(Response.Status.FORBIDDEN.getReasonPhrase(), Response.Status.FORBIDDEN);
        } else {
            throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
        }
    }
430849
@Route(method = HttpMethod.POST, uri = "/monitor/login")
    public Result authenticate(@FormParameter("username") String username, @FormParameter("password") String password) {
        if (!configuration.getBooleanWithDefault("monitor.auth.enabled", true)) {
            // If the authentication is disabled, just jump to the dashboard page.
            return dashboard();
        }

        final String name = configuration.getOrDie("monitor.auth.username");
        final String pwd = configuration.getOrDie("monitor.auth.password");

        if (name.equals(username) && pwd.equals(password)) {
            session().put("wisdom.monitor.username", username);
            logger().info("Authentication successful - {}", username);
            return dashboard();
        } else {
            logger().info("Authentication failed - {}", username);
            context().flash().error("Authentication failed - check your credentials");
            return login();
        }
    }
1163288
public void connect(String username, char[] password) {
        doConnect(() -> {
            return CommandContextFactory.getInstance().
                    newCommandContext(new CommandContextConfiguration.Builder()
                    .setUsername(username)
                    .setPassword(password)
                    .setErrorOnInteract(false)
                    .build());
        });
    }
45283
public B setBasicAuth(final String username, final String password) {
        String auth = Base64.encodeToString((username + ":" + password).getBytes(), Base64.NO_WRAP);
        httpParams.addHeader("Authorization", "Basic " + auth);
        return self();
    }
41694
protected Http buildHttpPostUserPreAuthRequest(final String username) {
        val usersRequest = new Http(HttpMethod.POST.name(),
            duoProperties.getDuoApiHost(),
            String.format("/auth/v%s/preauth", AUTH_API_VERSION));
        usersRequest.addParam("username", username);
        return usersRequest;
    }
113518
public void signin(String username, String password) {
		logger.debug("signin:" + username);

		Authentication request = new UsernamePasswordAuthenticationToken(username, password, null);
		SecurityContextHolder.getContext().setAuthentication(request);
	}
562892
public CouchDB auth(String username, String password) {
        return username(username).password(password);
    }
411521
@Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        if (authentication == null) {
            return authentication;
        }
        UsernamePasswordAuthenticationToken output = null;
        if (authentication instanceof UsernamePasswordAuthenticationToken) {
            output = (UsernamePasswordAuthenticationToken) authentication;
        } else {
            output = new UsernamePasswordAuthenticationToken(authentication, authentication.getCredentials(),
                            authentication.getAuthorities());
            output.setAuthenticated(authentication.isAuthenticated());
            output.setDetails(authentication.getDetails());
        }
        return delegate.authenticate(output);
    }
4565
public MongoDB auth(String username, String password) {
        return username(username).password(password);
    }
647280
public static SanePasswordProvider forUsernameAndPassword(
      final String username, final String password) {
    return new SanePasswordProvider() {
      @Override
      public String getUsername(String resource) {
        return username;
      }

      @Override
      public String getPassword(String resource) {
        return password;
      }

      @Override
      public boolean canAuthenticate(String resource) {
        return true;
      }
    };
  }
957388
function(name) {
                console.log('oauthInterface.user.username');

                var params = corbel.utils.extend(this.params, {});
                params.url = this._buildUri('username/' + name);
                params.method = corbel.request.method.GET;

                return this.request(params);
            }
447451
public static boolean authenticate(String userName, String userPassword) {
        LOGGER.entering(userName, StringUtils.isBlank(userPassword) ? userPassword : userPassword.replaceAll(".", "*"));
        boolean validLogin = false;
        byte[] currentAuthData;
        byte[] hashedInputData;
        if (StringUtils.isBlank(userName) || StringUtils.isBlank(userPassword)) {
            return validLogin;
        }
        try {
            File authFile = new File(AUTH_FILE_LOCATION);
            if (!authFile.exists()) {
                authFile.createNewFile();
                createAuthFile(authFile, DEFAULT_USERNAME, DEFAULT_PASSWORD);
            }
            currentAuthData = getBytesFromFile(authFile);
            hashedInputData = hashData(userName, userPassword);
            validLogin = Arrays.equals(currentAuthData, hashedInputData);
        } catch (Exception e) {
            validLogin = false;
        }
        LOGGER.exiting(validLogin);
        return validLogin;
    }
1334241
public static Map<String, String> createBasicAuthenticationProperty(final String username, final String password) {
        Map<String, String> map = new TreeMap<String, String>();
        try {
            String base64Binary = DatatypeConverter.printBase64Binary((username + ":" + password).getBytes("US-ASCII"));
            map.put("Authorization", "Basic " + base64Binary);
        } catch (UnsupportedEncodingException e) {
            // unreachable code
            throw new RuntimeException(e);
        }
        return map;
    }
1060605
public static aaauser_authorizationpolicy_binding[] get(nitro_service service, String username) throws Exception{
		aaauser_authorizationpolicy_binding obj = new aaauser_authorizationpolicy_binding();
		obj.set_username(username);
		aaauser_authorizationpolicy_binding response[] = (aaauser_authorizationpolicy_binding[]) obj.get_resources(service);
		return response;
	}
785266
public static Builder forAuth(final String auth) {
    // split with limit=2 to catch case where password contains a colon
    final String[] authParams = Base64.decodeAsString(auth).split(":", 2);

    if (authParams.length != 2) {
      return builder();
    }

    return builder()
        .username(authParams[0].trim())
        .password(authParams[1].trim());
  }