[英]Anonymous login unsupported on Parse Server (hosted by Azure)?
我最近将我的iOS应用程序从Parse迁移到了Azure托管的Parse Server。 除了使用PFAnonymousUtils登录匿名用户时出现此错误,一切似乎都按预期进行:
[Error]: This authentication method is unsupported. (Code: 252, Version: 1.14.2) Optional(Error Domain=Parse Code=252 "This authentication method is unsupported." UserInfo={code=252, temporary=0, error=This authentication method is unsupported., NSLocalizedDescription=This authentication method is unsupported.})
这是我在AppDelegate(didFinishLaunchingWith Options)中使用的登录顺序:
let configuration = ParseClientConfiguration {
$0.applicationId = "my-awesome-app-id"
$0.server = "https://awesomeapp.azurewebsites.net/parse/"
}
Parse.initialize(with: configuration)
let currentUser = PFUser.current()
if currentUser == nil {
PFAnonymousUtils.logIn {
(user: PFUser?, error: Error?) -> Void in
if error != nil || user == nil {
//See error above
print(error)
} else {
user?.saveInBackground()
}
}
}
我知道Parse Server支持匿名用户,这就是为什么我发现此错误令人困惑。 是否可能需要在Azure上的Parse Server上更改配置?
是的,您需要确保在parse-server配置enableAnonymousUsers
设置为true。
https://github.com/mamaso/parse-server-azure-config/blob/master/index.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.