couchbase/couchbase-lite-java-core — pull request #159 by pasin (2014-04-15 23:59:14+00:00)
Title: Implemented new Authenticator APIs

* Implemented new Authenticator APIs including AuthenticatorFactory and Authenticator class as defined on https://github.com/couchbaselabs/couchbase-lite-api/blob/master/gen/md/Replication.md.
* Implemented TokenAuthenticator which will be used for facebook and persona authenticator. This is inline with the iOS implementation.
* Implemented BasicAuthenticator used for basic authentication. Introduce authUserInfo() method called by RemoteRequest and ChangeTracker to add Basic Authentication to the request. The method is equivalent to authorizeURLRequest:forRealm: and authroizeHTTPMessage:forRealm: of the iOS implementation of CBLBasicAuthorizer class.

Additional things to review:
* Should the AuthenticatorFactory and Authenticator class be inside com.couchbase.lite.auth package or com.couchbase.lite.replicator? Currently they are in com.couchbase.lite.auth.
* Should AuthenticatorFacotyr.createPersonaAuthenticator(String assertion, String email) include email param? The email param doesn't get used now.
* BasicAuthenticator.loginParametersForSite() is currently returning null compared to the iOS implementation which return a dictionary containing username and password.