I am attempting to build a mobile app in Ember backed by CouchDB. I have 
things working with a regular server, but I get a 401 unauthorized error 
when attempting to connect to Couchbase Lite.

My code is pretty straightforward:

( function() {
    function setURL() {
        if( window.cblite ) {
            cblite.getURL( function( err, url ) {
                var adapter = 
App.__container__.lookup('store:main').adapterFor( 'application' )
                url = url.substring( 0, url.length - 1 ) // strip trailing /
                Ember.set( adapter, 'host', url )
            } )
        }
    }
    document.addEventListener( 'deviceready', setURL, false )
} )()

This gets a http://user:pass@localhost style url and sets it for the 
adapter, but subsequent requests to the database are rejected.

I have experienced HTTP Auth issues with 
xmlhttprequest<http://stackoverflow.com/questions/23641433/does-xmlhttprequest-strip-credentials-from-url-when-specifying-a-port>before
 where the credentials seemed to be stripped when connecting to a 
port other than 80.

I was just wondering if anyone else was accessing a Couchbase Lite instance 
through jQuery, and if you had authentication issues.

-Will

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/99bfa861-e197-435f-85f5-b5e71c0cdad1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to