Posts an XAuth request. A new method is needed because the response from
the server is not a standard Tumblr JSON response.
@param email the user's login email.
@param password the user's password.
@return the login token.
14726
public Token postXAuth(final String email, final String password) {
        OAuthRequest request = constructXAuthPost(email, password);
        setToken("", ""); // Empty token is required for Scribe to execute XAuth.
        sign(request);
        return clearXAuth(request.send());
    }
664670
def post(self, request):
        ''''''
        serializer = CreateTokenSerializer(data=request.data)
        serializer.is_valid(raise_exception=True)

        email = serializer.validated_data.get('email')
        password = serializer.validated_data.get('password')
        user = authenticate(username=email, password=password)
        if not user:
            return Response(status=status.HTTP_401_UNAUTHORIZED)

        Token.objects.filter(user=user).delete()
        token = Token.objects.create(user=user)

        return Response(
            status=status.HTTP_201_CREATED, data={'token': token.key})
613019
public static SignUpResponse signUp(String username, String email, String password){
        return signUp(new SignUpCredentials(username,email,password));
    }
1158747
function doLogin (opts, csrf, email, password) {
  return fetch(`${opts.host}/_/auth/login`, json({
    ...opts,
    method: 'post',
    body: { csrf, email, password }
  })).then((response) => props({
    session: getSessionCookie(response.headers.get('set-cookie')),
    body: getJSON(response)
  }))
}
743015
public static function login($key, $email, $password)
    {
        $params = [
            "username" => $email,
            "password" => $password,
        ];

        $headers = [
            'W-Key' => $key
        ];

        $login = new static();
        $response = $login->makeRequest("login", self::METHOD_POST, $params, $headers);

        return $response;
    }
690231
def send_login_email(app_id, token, hook, email=None, user_id=None, lang="en_US",
                     url_login='https://pswdless.appspot.com/rest/login'):
    '''
    
    '''
    return SendLoginEmail(app_id, token, hook, email, user_id, lang, url_login)
57934
public static final HttpClientAuthProvider forUser(final String login, final String password)
    {
        return new HttpClientDefaultAuthProvider(null, null, -1, null, login, password);
    }
138782
public function changePassword($email, $token, $password)
    {
        global $logger;
        $path     = 'users/password/change';
        $request = $this->_remoteServer->post($path)
            ->setPostField('email', $email)
            ->setPostField('token', $token)
            ->setPostField('password', $password);
        try {
            $response = $request->send();
        } catch(\Guzzle\Http\Exception\BadResponseException $e) {
            $logger->info($e->getResponse()->getBody('true'), array());
            return false;
        }
        return true; 

    }
13523
private UsernamePasswordToken usernamePassword(ServiceRequestContext ctx, AggregatedHttpMessage req) {
        // check the Basic HTTP authentication first (https://tools.ietf.org/html/rfc7617)
        final BasicToken basicToken = AuthTokenExtractors.BASIC.apply(req.headers());
        if (basicToken != null) {
            return new UsernamePasswordToken(basicToken.username(), basicToken.password());
        }

        final MediaType mediaType = req.headers().contentType();
        if (mediaType != MediaType.FORM_DATA) {
            return throwResponse(ctx, HttpStatus.BAD_REQUEST,
                                 "The content type of a login request must be '%s'.", MediaType.FORM_DATA);
        }

        final Map<String, List<String>> parameters = new QueryStringDecoder(req.contentUtf8(),
                                                                            false).parameters();
        // assume that the grant_type is "password"
        final List<String> usernames = parameters.get("username");
        final List<String> passwords = parameters.get("password");
        if (usernames != null && passwords != null) {
            final String username = usernames.get(0);
            final String password = passwords.get(0);
            return new UsernamePasswordToken(loginNameNormalizer.apply(username), password);
        }

        return throwResponse(ctx, HttpStatus.BAD_REQUEST,
                             "A login request must contain username and password.");
    }
1246140
def login(email, password)
      response = get('/loginUser', { email: email, password: password }, false)
      @token = response.body["valtoken"]
    end
837207
public static SignInResponse signIn(String email, String password){
        return signIn(new LoginCredentials(email,password));
    }
693017
public static Observable<BackendUser> signInInBackground(String email, String password){
        return getAM().loginASync(new LoginCredentials(email, password));
    }
1271090
def signin(email, password)
      result = self.post "/user/signin/login", {
        :email => email,
        :pwd => password,
        :service => "nudge"
      }
      if !result['error'].nil? && !result['error']['msg'].nil?
        msg = result['error']['msg']
      else
        msg = "Error logging in"
      end
      raise ApiError.new(400, "error", msg) if result['token'].nil?
      @auth[:token] = result['token']
      @auth[:xid] = result['user']['xid']
      @auth[:user] = result['user']
      return_response result
    end
959432
@Override
    public List<Object> loginRequest() {
        String token = token();
        if (token == null)
            return null;
        Map<String, String> loginParams = new HashMap<String, String>();
        loginParams.put(kLoginParamAccessToken, token);
        return Arrays.asList("POST", "_facebook", loginParams);
    }
1363243
@Nullable
    public OAuthConnection parse(String email) {
        String domain = extractDomain(email);
        if (domain == null) {
            return null;
        }

        domain = domain.toLowerCase();
        for (OAuthConnection c : connections) {
            String mainDomain = domainForConnection(c);
            if (domain.equalsIgnoreCase(mainDomain)) {
                return c;
            }

            List<String> aliases = c.valueForKey(DOMAIN_ALIASES_KEY, List.class);
            if (aliases != null) {
                for (String d : aliases) {
                    if (d.equalsIgnoreCase(domain)) {
                        return c;
                    }
                }
            }
        }
        return null;
    }
46581
@RequestMapping(value = "/gettoken", method = {RequestMethod.POST})
    @ResponseBody
    public ResponseMessage getToken(HttpServletRequest request, HttpServletResponse response) {
        String username = StringUtil.EMPTY_STRING;
        String password = StringUtil.EMPTY_STRING;
        ResponseMessage result = new ResponseMessage();
        try {
            JSONObject json = tgtools.web.util.RequestHelper.parseRequest(request);
            if (json.has("username")) {
                username = json.getString("username");
            }
            if (json.has("password")) {
                password = json.getString("password");
            }

            mUserService.validLoginUser(username, password);
            String token = mUserService.createToken(username, request.getRemoteAddr());
            result.setStatus(true);
            result.setData(token);
        } catch (Exception e) {
            result.setStatus(false);
            result.setData(e.getMessage());
        }
        return result;
    }
98905
public static boolean registerToken(String token, String email, URL site) {
        List<String> key = new ArrayList<String>();
        key.add(email);
        key.add(site.toExternalForm().toLowerCase());
        sRegisteredTokens.put(key, token);
        return true;
    }