I am stuck trying to log into the Realm Object Server (ROS) from my app. I rolled my own log in scheme with a Keychain wrapper but would like to use Realm and the ROS with the cloud.
But I cannot write or find a simple way to log in using the username/password credentials. This is the server error: auth.password: Handle request failed with: InvalidCredentials: The provided credentials are invalid or a user does not exist.: Given account:
I am logged in to the ROS via the terminal and my cloud provider on the ROS dashboard. I can see my name and userID but it says I have no Realms.
How would connect my app to the server url to log in?
Here's something (among 10 different things) I've tried:
private func setUpPermissions() {
SyncUser.logIn(with: .usernamePassword(username: username, password: password, register: false), server: syncServerURL) { (user, error) in
guard user != nil else {
print(error!.localizedDescription)
return
}
do {
// This is where I get stuck
print("Logged in successfully")
} catch {
print(error.localizedDescription)
}
}
}
}
I haven't found ant of good examples (just code snippets) so apologies for my own code.