Starting email auth

@param email email for authentication
@return promise of AuthStartRes
341729
@NotNull
    @ObjectiveCName("doStartAuthWithEmail:")
    public Promise<AuthStartRes> doStartEmailAuth(String email) {
        return modules.getAuthModule().doStartEmailAuth(email);
    }
1097060
public void loginWithEmail(String email, String password, final SimpleLoginAuthenticatedHandler completionHandler) {
    if (!Validation.isValidEmail(email)) {
      handleInvalidEmail(completionHandler);
    }
    else if (!Validation.isValidPassword(password)) {
      handleInvalidPassword(completionHandler);
    }
    else {
      HashMap<String, String> data = new HashMap<String, String>();
      data.put("email", email);
      data.put("password", password);

      makeRequest(Constants.FIREBASE_AUTH_PASSWORD_PATH, data, new RequestHandler() {
        public void handle(FirebaseSimpleLoginError error, JSONObject data) {
          if (error != null) {
            completionHandler.authenticated(error, null);
          }
          else {
            try {
              String token = data.has("token") ? data.getString("token") : null;
              if (token == null) {
                JSONObject errorDetails = data.has("error") ? data.getJSONObject("error") : null;
                FirebaseSimpleLoginError theError = FirebaseSimpleLoginError.errorFromResponse(errorDetails);
                completionHandler.authenticated(theError, null);
              }
              else {
                JSONObject userData = data.has("user") ? data.getJSONObject("user") : null;
                if (userData == null) {
                  FirebaseSimpleLoginError theError = FirebaseSimpleLoginError.errorFromResponse(null);
                  completionHandler.authenticated(theError, null);
                }
                else {
                  attemptAuthWithToken(token, Provider.PASSWORD, userData, completionHandler);
                }
              }
            }
            catch (JSONException e) {
              e.printStackTrace();
              FirebaseSimpleLoginError theError = FirebaseSimpleLoginError.errorFromResponse(null);
              completionHandler.authenticated(theError, null);
            }
          }
        }

      });
    }
  }
188340
public com.authy.api.User createUser(String email, String phone, String countryCode) {
		User user = new User(email, phone, countryCode);
		
		String content = this.post(NEW_USER_PATH, user);

		return userFromXml(this.getStatus(), content);
	}
663625
public GitkitUser getUserByEmail(String email)
      throws GitkitClientException, GitkitServerException {
    Preconditions.checkNotNull(email);
    try {
      JSONObject result = rpcHelper.getAccountInfoByEmail(email);
      return jsonToUser(result.getJSONArray("users").getJSONObject(0));
    } catch (JSONException e) {
      throw new GitkitServerException(e);
    }
  }
26624
def login(self, email, password):
        
        rsp = self._request()
        self.default_headers['Authorization'] = rsp.data['token']
        return rsp
269217
def start(config=Mail::Configuration.instance, &block)
        raise ArgumentError.new("Mail::Retrievable#imap_start takes a block") unless block_given?

        if settings[:enable_starttls] && settings[:enable_ssl]
          raise ArgumentError, ":enable_starttls and :enable_ssl are mutually exclusive. Set :enable_ssl if you're on an IMAPS connection. Set :enable_starttls if you're on an IMAP connection and using STARTTLS for secure TLS upgrade."
        end

        imap = Net::IMAP.new(settings[:address], settings[:port], settings[:enable_ssl], nil, false)

        imap.starttls if settings[:enable_starttls]

        if settings[:authentication].nil?
          imap.login(settings[:user_name], settings[:password])
        else
          # Note that Net::IMAP#authenticate('LOGIN', ...) is not equal with Net::IMAP#login(...)!
          # (see also http://www.ensta.fr/~diam/ruby/online/ruby-doc-stdlib/libdoc/net/imap/rdoc/classes/Net/IMAP.html#M000718)
          imap.authenticate(settings[:authentication], settings[:user_name], settings[:password])
        end

        yield imap
      ensure
        if defined?(imap) && imap && !imap.disconnected?
          imap.disconnect
        end
      end
946666
public MailBuilder from(String name, String email) {
        return param("from", email(name, email));
    }
1226338
@NotNull
    @ObjectiveCName("doStartAuthWithPhone:")
    public Promise<AuthStartRes> doStartPhoneAuth(long phone) {
        return modules.getAuthModule().doStartPhoneAuth(phone);
    }
633076
public static Observable<BackendUser> signUpInBackground(String username, String email, String password){
        return getAM().signUpASync(new SignUpCredentials(username, email, password));
    }
13468
def get_client(self, email=None, password=None, **__):
        """"""
        if self.client is not None:
            return self.client
        return Auth(email, password)
285985
public boolean email(final Principal principal,
                         final String attribute,
                         final EmailProperties emailProperties,
                         final String body) {
        if (StringUtils.isNotBlank(attribute) && principal.getAttributes().containsKey(attribute) && isMailSenderDefined()) {
            val to = getFirstAttributeByName(principal, attribute);
            if (to.isPresent()) {
                return email(emailProperties, to.get().toString(), body);
            }
        }
        LOGGER.debug("Email attribute [{}] cannot be found or no configuration for email provider is defined", attribute);
        return false;
    }
1305114
async function isAuthenticated({ email, password }) {
  let user = null
  try {
    user = await User.query().where('email', '=', email)
    if (user && bcrypt.compareSync(password, user[0].password)) return user[0]
  } catch (e) { }
  return null
}
674669
public void setEmail(String email) {

        checkEmail(email);
        if (email != null) {
            email = email.trim();
        }
        m_email = email;
    }
125030
public ApiResponse authorizeAppUser(String email, String password) {
        validateNonEmptyParam(email, "email");
        validateNonEmptyParam(password,"password");
        assertValidApplicationId();
        loggedInUser = null;
        accessToken = null;
        currentOrganization = null;
        Map<String, Object> formData = new HashMap<String, Object>();
        formData.put("grant_type", "password");
        formData.put("username", email);
        formData.put("password", password);
        ApiResponse response = apiRequest(HttpMethod.POST, formData, null,
                organizationId, applicationId, "token");
        if (response == null) {
            return response;
        }
        if (!isEmpty(response.getAccessToken()) && (response.getUser() != null)) {
            loggedInUser = response.getUser();
            accessToken = response.getAccessToken();
            currentOrganization = null;
            log.info("Client.authorizeAppUser(): Access token: " + accessToken);
        } else {
            log.info("Client.authorizeAppUser(): Response: " + response);
        }
        return response;
    }
380277
public boolean start() {
        Intent emailIntent = build();
        try {
            startActivity(emailIntent);
        } catch (ActivityNotFoundException e) {
            return false;
        }

        return true;
    }
693914
public function setAuthentication($email, $apiKey)
    {
        $headers = [
            self::HEADER_USER_EMAIL => $email,
            self::HEADER_API_KEY    => $apiKey,
        ];
        
        $this->service->setHeaders($headers, true, true);
        
        return $this;
    }
1037075
function sendVerificationEmail (req, res, next) {
  // skip if we don't need to send the email
  if (!req.sendVerificationEmail) {
    next()

  // send the email
  } else {
    var user = req.user

    var ttl = (settings.emailVerification &&
      settings.emailVerification.tokenTTL) ||
      (3600 * 24 * 7)

    OneTimeToken.issue({
      ttl: ttl,
      sub: user._id,
      use: 'emailVerification'
    }, function (err, token) {
      if (err) { return next(err) }

      var params = {
        token: token._id
      }

      ;[ 'redirect_uri', 'client_id', 'response_type', 'scope' ]
        .forEach(function (key) {
          var value = req.connectParams[key]
          if (value) {
            params[key] = value
          }
        })

      // build email link
      var verifyURL = url.parse(settings.issuer)
      verifyURL.pathname = 'email/verify'
      verifyURL.query = params

      // email template data
      var locals = {
        email: user.email,
        name: {
          first: user.givenName,
          last: user.familyName
        },
        verifyURL: url.format(verifyURL)
      }

      // Send verification email
      mailer.getMailer().sendMail('verifyEmail', locals, {
        to: user.email,
        subject: 'Verify your e-mail address'
      }, function (err, responseStatus) {
        if (err) { }
        // TODO: REQUIRES REFACTOR TO MAIL QUEUE
        next()
      })
    })
  }
}