basic auth at url with special chars

27 views
Skip to first unread message

sleith

unread,
Mar 20, 2015, 11:12:35 AM3/20/15
to mobile-c...@googlegroups.com
Hi,
i have a problem setting up remote db url with basic auth in that url.
I test, some characters not able to get through, the log shown it's unreachable.
The characters are:
@/?%[]#
I tried uri encoding, but still same problem.

For example i set password: test123#
App logged:

error=Error Domain=CBLHTTP Code=401 "The operation couldn’t be completed. (CBLHTTP error 401.)" UserInfo=0x7ce54b50 {NSErrorFailingURLKey=https://7025fdcfd7b242f7b24e7bd48f6c4ee6:test123%2...@website.com:443/d88284e1b96d419a93cf65144520d6f2/_changes?feed=normal&heartbeat=300000&style=all_docs, HTTPAuthorization=Basic NzAyNWZkY2ZkN2IyNDJmN2IyNGU3YmQ0OGY2YzRlZTY6dGVzdDEyMyUyMw==, HTTPAuthenticateHeader=Basic realm="server"}
20:48:23.286| Sync: CBLReplication[from https://7025fdcfd7b242f7b24e7bd48f6c4ee6:*****@website:443/d88284e1b96d419a93cf65144520d6f2]: stopped, progress = 0 / 0, err: The operation couldn’t be completed. (CBLHTTP error 401.)

Is there any way how to fix this?
Thanks

Jens Alfke

unread,
Mar 20, 2015, 3:52:22 PM3/20/15
to mobile-c...@googlegroups.com
This may be a bug :( Could you file an issue, please?

If you’re using the native API, use the CBLReplication API to authorize, instead of putting the parameters in the URL. But if you’re using the REST API (i.e. PhoneGap) I don’t think there’s a workaround, other than avoiding those characters in passwords.

—Jens

dyowee

unread,
Mar 20, 2015, 6:48:40 PM3/20/15
to mobile-c...@googlegroups.com
I am using CBLAuthenticator and special characters are working ok
Reply all
Reply to author
Forward
0 new messages