You may want to authenticate with the CouchDB server, if it requires it. Sohva supports two authentication methods from CouchDB:
- basic authentication
- OAuth 1
CouchClient class has methods to start sessions with either of these methods. A Session is basically the same as
CouchClient except that all issued requests will include proper credentials so that the server can authenticate your requests.
Once you get a session object, instead of using the basic
couch object from Basic usage, use the session to access the databases.
To start a basic authentication session, use the
val session = couch.startBasicSession("username", "password") val db = session.database("test")
To start an OAuth session, use the
val session = couch.startOAuthSession("consumer_key", "consumer_secret", "token", "secret") val db = session.database("test")