Create an instance of the FormLoginAuthenticator.
<p>
Protected so it can be overridden in unit tests.
961909
protected FormLoginAuthenticator createFormLoginAuthenticator(WebRequest webRequest) {
        WebAuthenticator ssoAuthenticator = providerAuthenticatorProxy.getSSOAuthenticator(webRequest, null);
        return new FormLoginAuthenticator(ssoAuthenticator, webAppSecurityConfig, providerAuthenticatorProxy);
    }
702889
public boolean login() throws LoginException {
    NameCallback user = new NameCallback("Login:");
    PasswordCallback pass = new PasswordCallback("Password:", false);
    PasswordEncryptionService enc = new PasswordEncryptionService();

    try {
      callback(user, pass);

      BufferedReader reader = new BufferedReader(new FileReader(passwordFile));

      while (reader.ready()) {
        String[] fields = reader.readLine().split(":");
        if (fields[0].equals(user.getName())) {
          String loginPassword = new String(pass.getPassword());
          byte[] salt = StringUtil.hexToByteArray(fields[2]);
          byte[] realDigest = StringUtil.hexToByteArray(fields[1]);
          if (enc.authenticate(loginPassword, realDigest, salt)) {
            addPrincipal(new UserPrincipal(fields[0]));
            for (int i = 3; i < fields.length; i++) {
              addPrincipal(new RolePrincipal(fields[i]));
            }
            return true;
          }
          break;
        }
      }
    } catch (FileNotFoundException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      /* nothing to do. */
    } catch (UnsupportedCallbackException e) {
      /* nothing to do. */
    }

    throw new FailedLoginException();
  }
552412
private void initializeSecurityManager(SubjectAwareDescriptor subjectAware)
  {
    String cfg = subjectAware.getConfiguration();

    if (cfg.length() > 0)
    {
      Factory<SecurityManager> factory = new IniSecurityManagerFactory(cfg);
      SecurityManager securityManager = factory.getInstance();

      SecurityUtils.setSecurityManager(securityManager);
    }

    String username = subjectAware.getUsername();

    if ((username != null) && (username.length() > 0))
    {
      UsernamePasswordToken token = new UsernamePasswordToken(username,
                                      subjectAware.getPassword());

      SecurityUtils.getSubject().login(token);
    }
  }
306126
@Path("authenticate")
    @POST
    @Produces(MediaType.APPLICATION_JSON)
    public TokenDto authenticate(@FormParam("username") String username, @FormParam("password") String password) {
        UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
        Authentication authentication = this.authManager.authenticate(authenticationToken);
        SecurityContextHolder.getContext().setAuthentication(authentication);

        return new TokenDto(TokenUtils.createToken((UserDetails) authentication.getPrincipal()));
    }
694570
public static Authenticator buildAuthenticatorWithJwk(final String location) {
        if (location != null && isUrl(location)) {
            return new JwksAuthenticator(location);
        }
        return null;
    }
1167107
public static SessionProvider createAnonimProvider()
   {
      Identity id = new Identity(IdentityConstants.ANONIM, new HashSet<MembershipEntry>());
      return new SessionProvider(new ConversationState(id));
   }
279311
public GlobusCredential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime,
        int delegationMode) throws GeneralSecurityException {
        return createCredential(certs, privateKey, bits, lifetime, delegationMode, (X509ExtensionSet) null, null);
    }
345624
protected SecurityHandler createSecurityHandler() throws Exception {
        HashLoginService l = new HashLoginService();
        // UserStore is now separate store entity and must be added to HashLoginService
        UserStore userStore = new UserStore();
        l.setUserStore(userStore);
        for (User user : Users.getUsers()) {
            userStore.addUser(user.getId(), Credential.getCredential(user.getPassword()), user.getRolesAsArray());
        }
        l.setName("apimanrealm");

        ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
        csh.setAuthenticator(new BasicAuthenticator());
        csh.setRealmName("apimanrealm");
        csh.setLoginService(l);

        return csh;
    }
803170
public static Authentication login(String username, String password) {
        return new AuthenticationImpl(username, password, AuthMode.Login);
    }
889291
def create(self, request, *args, **kwargs):
        """"""
        if not request.user.is_authenticated:
            raise exceptions.NotFound

        return super().create(request, *args, **kwargs)
1054849
@Nonnull
  public static <T> UBL20ValidatorBuilder <T> create (@Nonnull final Class <T> aClass)
  {
    return new UBL20ValidatorBuilder <> (aClass);
  }
153011
public void createAccount() {
    mAccount = new AccountFactory(mAccountConfig).setHttpClient(httpclient).createAccount();
    mAccess = mAccount.getAccess();
    if (mRegion != null) {
      mAccess.setPreferredRegion(mRegion);
    }
  }
716541
public <T extends AbstractGoogleJsonClient.Builder> T fromCredential(T builder, Credential credential) {
    Preconditions.checkNotNull(builder);
    Preconditions.checkNotNull(credential);
    return prepareBuilder(builder, credential, null);
  }
1042744
@Override
    protected MailResourcesHolder createResourceImpl()
    {
        //create authenticator
        Authenticator authenticator=null;
        if(this.password!=null)
        {
            authenticator=new MailAuthenticator(this.userName,this.password);
        }
        
        //create session
        Session session=Session.getInstance(this.mailConnectionProperties,authenticator);

        //create transport
        Transport transport=this.createTransport(session);
        
        //create holder
        MailResourcesHolder resource=new MailResourcesHolder(session,transport);
        
        return resource;
    }
296061
public static ValidatorConfiguration createExperimental() {
        Map<Check, Level> checks = getStandardChecks();

        checks.put(GdlArityCheck.INSTANCE, Level.ERROR);
        checks.put(GdlNotInRuleHeadCheck.INSTANCE, Level.ERROR);
        checks.put(UnrecognizedGdlArgumentCheck.INSTANCE, Level.WARNING);

        // (gdl random)
        checks.put(GdlRandomGoalCheck.INSTANCE, Level.ERROR);

        return new ValidatorConfiguration(checks);
    }
650290
private Cookie logInAndObtainCookie(String testName, WebClient webClient, String protectedUrl, String username, String password, String cookieName,
                                        Expectations expectations) throws Exception {
        Page response = invokeProtectedUrlAndValidateResponse(testName, webClient, protectedUrl, expectations);
        doFormLoginAndValidateResponse(response, username, password, expectations);

        Cookie cookie = webClient.getCookieManager().getCookie(cookieName);
        assertNotNull("Cookie [" + cookieName + "] was null but should not have been.", cookie);
        return cookie;
    }
1097305
public static FormInputHandler create() {
		return new FormInputHandler(WebElementFinder.create().noLogging(true), null, null, null, null, null, null, null, null);
	}