Hi
I’m working on a Xamarin .NET app which requires replication. I have an existing server and infrastructure that has been working fine for a good while using the old 1.4 Couchbase Lite and 1.5 sync gateway.
I’ve have updated to the latest couchbase lite and the newest sync gateway.
My server authenticates using the POST against _session and retrieves the session cookie etc.and returns this back to the client ready to be used.
I then try to start replication using the this session id using the following code and it ALWAYS returns:
Couchbase.Lite.CouchbaseLiteException: CouchbaseLiteException (LiteCoreDomain / 26): Authentication failed, see inner exception
(there is nothing in the inner exception).
Which is odd as I have already authenticated successfully using _session.
the URL I am using is of the form:
“wss://xxx.yyyy.zzz:4984/mydatabasename”
The code I am using is as follows:
var targetEndpoint = new URLEndpoint(new Uri(config.CouchbaseGatewayServiceUrl));
var replConfig = new ReplicatorConfiguration(database, targetEndpoint);
replConfig.ReplicatorType = ReplicatorType.PushAndPull;
replConfig.Continuous = true;
replConfig.Authenticator = new SessionAuthenticator(session.CookieValue);
replicator = new Replicator(replConfig);
replicator.AddDocumentReplicationListener((object sender, DocumentReplicationEventArgs e) =>
{
Debug.WriteLine($"Doc Count {e.Documents.Count}");
});
replicator.AddChangeListener((sender, changeArgs) =>
{
if (changeArgs.Status.Error != null)
{
// *************** ALWAYS has an error ***************
Console.WriteLine($"Error :: {changeArgs.Status.Error}");
}
Debug.WriteLine($"Change Id Status {changeArgs.Status.Activity} Progress {changeArgs.Status.Progress}");
});
replicator.Start();
Any thoughts of what I have missed?