Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

Signup Failed: authentication via 'local-userpass' is unsupported

We are going through the getting started guide (crafting a macOS app) and are getting an authentication failure when attempting to sign up

Signup failed: Error Domain=realm::app::ServiceError Code=-1 "authentication via 'local-userpass' is unsupported" UserInfo={NSLocalizedDescription=authentication via 'local-userpass' is unsupported, realm::app::ServiceError=Unknown}

So to double check ourselves, we downloaded the repo project, built and ran it and got the exact same error.

We’ve checked the Atlas->Realm project console, in the Users->providers section and both Anonymous sign in as well as Email/Password are On and configured.

We know it’s the correct AppID as the log is showing the login attempts failing. I am not including the code as it’s the code in the repo project itself

The error log from the console shows this

Error:
authentication via ‘local-userpass’ is unsupported

Thoughts?

Edit:

Since anonymous sign is On in the console we tried to use anonymous login using the code from the iOS SDK’s section

app.login(withCredential: AppCredentials.anonymous()) { (user, error) in
    // Remember to dispatch back to the main thread in completion handlers
    // if you want to do anything on the UI.
    DispatchQueue.main.sync {
        guard error == nil else {
            print("Login failed: \(error!)")
            return
        }

        // Now logged in, do something with user

    }
}

which results in this error

Login failed: Error Domain=realm::app::ServiceError Code=2 “authentication via ‘anon-user’ is unsupported” UserInfo={NSLocalizedDescription=authentication via ‘anon-user’ is unsupported, realm::app::ServiceError=InvalidSession}

This issue magically rectified itself without us changing anything. Go figure.

It usually comes when your app changes is not deployed.
Once deploy completed you wont get this.

@Amiya_Panigrahi

Thanks for the reply. The problem was the website would give an error when we attempted to deploy and it was unclear what to do about the error or how to correct it. After deleting everything - all apps, all clusters, every piece of data 3 times over a two day period, 4th time was a charm and the errors subsided.