简体   繁体   English

Parse Server(由Azure托管)不支持匿名登录?

[英]Anonymous login unsupported on Parse Server (hosted by Azure)?

I recently migrated my iOS application from Parse to a Parse Server hosted on Azure. 我最近将我的iOS应用程序从Parse迁移到了Azure托管的Parse Server。 Everything appears to be working as expected except that I get this error when I use PFAnonymousUtils to log in an Anonymous user: 除了使用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.}) 

Here is the login sequence I am using in the AppDelegate (didFinishLaunchingWith Options): 这是我在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()
                }
            }
        }

I know that Anonymous Users are supported in Parse Server, which is why I find this error baffling. 我知道Parse Server支持匿名用户,这就是为什么我发现此错误令人困惑。 Is it possible that I need to change a configuration on my Parse Server on Azure? 是否可能需要在Azure上的Parse Server上更改配置?

Yes you need to ensure enableAnonymousUsers is set to true in parse-server config. 是的,您需要确保在parse-server配置enableAnonymousUsers设置为true。

https://github.com/mamaso/parse-server-azure-config/blob/master/index.js https://github.com/mamaso/parse-server-azure-config/blob/master/index.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM