从Auth0调用时解析AWS 503错误,从本地

时间:2016-11-29 20:37:54

标签: amazon-web-services parse-platform

我正在尝试实现描述here的Auth0集成。登录尝试返回404,这很好。

但是在POST上我得到了 54.67.15.170 - - [28 / Nov / 2016:14:26:54 +0000]“GET / parse / login?username = auth0%7C0123456789& password = XXXXXX HTTP / 1.1”404 49 54.67.15.170 - - [28 / Nov / 2016:14:26:55 +0000]“POST / parse / users / HTTP / 1.1”503 299

从本地创建用户: curl -X POST -H“X-Parse-Application-Id:appid”-H“X-Parse-REST-API-Key:mk”-H“Content-Type:application / json”-d'{“username” :“Sean Plott”,“密码”:“aaaaaa”}'https://tablebuds.com/parse/users { “的ObjectID”: “2H32s7C45c”, “createdAt”: “2016-11-28T14:29:50.515Z”, “sessionToken”: “R:XXXXX”} 工作正常。

任何人都可以建议我应该看一下吗?

3 个答案:

答案 0 :(得分:0)

POST的参数到底是什么?以下是文档所说的内容:

curl -X POST \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "X-Parse-Revocable-Session: 1" \
  -H "Content-Type: application/json" \
  -d '{"username":"cooldude6","password":"p_n7!-e8","phone":"415-392-0202"}' \
  https://YOURAWS/parse/users

我认为X-Parse-REST-API-Key在解析服务器上是可选的。

答案 1 :(得分:0)

我认为问题在于调用方式。删除失败的初始request.get消除了服务器上似乎围绕ParseServer.js:395的问题          process.on(' uncaughtException',function(err){           if(err.code ===" EADDRINUSE"){

 request.get({
 url: SERVER_NAME + '/parse/login',
 qs: {
     username: username,
     password: PARSE_USER_PASSWORD
     },
     headers: {
       'X-Parse-Application-Id': PARSE_APP_ID,
       'X-Parse-REST-API-Key': PARSE_API_KEY
     } 
}, function (err, response, body) {

if (err) return callback(err);
// user was found, add sessionToken to user profile
if (response.statusCode === 200) {
    user.parse_session_token = JSON.parse(body).sessionToken;
    return callback(null, user, context);
} // Not found. Likely the user doesn’t exist, we provision one
if(response.statusCode === 404) {
   request.post({
   url: SERVER_NAME + '/parse/users',
   json: {
   username: username,
   password: PARSE_USER_PASSWORD,
   email: email,
   emailVerified: true
},
headers: {
 'X-Parse-Application-Id': PARSE_APP_ID,
 'X-Parse-REST-API-Key': PARSE_API_KEY,
 'Content-Type': 'application/json'
 }
}, function (err, response, body) {
 if (err) return callback(err);
    // user created, add sessionToken to user profile
    if (response.statusCode === 201) {
    user.parse_session_token = body.sessionToken;
 return callback(null, user, context);
}
  return callback(new Error("The user provisioning returned a)));
});
}

答案 2 :(得分:0)

图示出来!创建日志文件的权限抛出导致服务器关闭并错过第二个调用的异常。谢谢。