使用Facebook登录解析服务器时出错

Jac*_*yle 7 facebook heroku mongodb ios parse-server

我是使用https://parse.com/docs/server/guide作为指南从Parse迁移到Heroku(带MongoLab沙箱)的众多用户之一.

迁移的事情进展顺利(可以通过远程仓库上的REST命令创建/检索对象),直到我尝试使用(iOS)Facebook登录.

方法:

[PFFacebookUtils logInInBackgroundWithReadPermissions: ... ]
Run Code Online (Sandbox Code Playgroud)

当Parse托管时,它一直在工作,现在返回以下错误:

[Error]: Facebook auth is invalid for this user. (Code: 101, Version: 1.12.0)
Run Code Online (Sandbox Code Playgroud)

注意:对我(之前工作的)iOS代码的唯一更改是将Parse服务器指向我新的手动托管的repo,如下所示:

 let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in
        ParseMutableClientConfiguration.applicationId = "<*APP ID*>"
        ParseMutableClientConfiguration.clientKey = "<*CLIENT KEY*>"
        ParseMutableClientConfiguration.server = "https://<*HEROKU APP ID*>.herokuapp.com/parse"
    })

 Parse.initializeWithConfiguration(parseConfiguration) 
Run Code Online (Sandbox Code Playgroud)

对开源解析服务器代码(https://github.com/ParsePlatform/parse-server-example)的唯一修改是替换配置以匹配我的Parse/mongo标识:

var api = new ParseServer({
  databaseURI:     'mongodb://<*UNIUQUE ID*>' || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: '<*PARSE APP ID*>',
  masterKey: '<*PARSE MASTER KEY*>'
});
Run Code Online (Sandbox Code Playgroud)

Ada*_*run 9

你需要添加包含有效的Facebook应用程序ID数组的关键facebookAppIds,这是提到这里的文档.

或者,添加FACEBOOK_APP_ID密钥作为引用[here](https://github.com/ParsePlatform/parse-server/issues/82)

  • 我还必须允许User类的所有类级别权限,特别是"添加字段" (2认同)