I try to set a basic authentication. When I set simple password push replication works great.
let pass : String = CouchbaseDatabaseUtils.passwordForServiceName(NetService.nameAndId())
let user : String = NetService.serviceUserName()
list.setPasswords([user : pass])
The problem i when my password generator provides string with special characters that is eg. “/” -> "%2f" special characters
No matter how hard I try, either via replication authenticator property or putting user and password inside of the url, replication does not work. What is the most strange is that when I set password in the listener with a encoded form it works. I is unexceptable solution becouse I have to deal with Android as well from which pushes works as expected. So my conclusion is that iOS implementation wants to compare stored password "/K+afvYT… with encoded “%2FK+afvYT…” while it should know that incoming connection is encoded and decode incoming or encode stored and then make comparisation.
Thanks for response. Yes, I know, I tried this method at first but with no success. I’m not sure now but I think it was working with saved encoded version of the password. That’s lead me to the conclusion that there is something wrong with passwords comparison,
I found an existing issue that’s the same as what you’re getting. Look at the later comments for the explanation — in short, the replicator won’t use Basic auth over plain HTTP for security reasons, so it uses Digest instead, but the Listener component doesn’t handle digest auth.
The workaround is to enable SSL in the listener (which is a good idea anyway.) See the issue for instructions.