簡體   English   中英

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

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM