Search:

Search all manuals
Search this manual
Manual
Couchbase Developer's Guide 2.0
Community Wiki and Resources
Download Couchbase Server 2.0
Couchbase Server 2.0 Manual
Client Libraries
Couchbase Server Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
5.2 Connecting to Couchbase Server
Chapter Sections
Chapters

5.2.3. Authenticating a Client

When you create a connection to the Couchbase Server, you are actually creating a new instance of a Couchbase client object which contains your connection information. Typically when you establish a bucket for your application, either in Couchbase Admin Console, or via a REST API call, you provide required credentials. When you connect to the bucket, provide your username and password as parameters in your SDK call to Couchbase.connect():

Couchbase.connect("http://<host>:8091/pools",
                                          :bucket => 'bucket1',
                                          :username => 'Administrator',
                                          :password => 'password')

This next example demonstrates use of credentials in PHP:

<?php
        $cb = new Couchbase(”<host>:8091", "bucketname", "password", "user");
        ?>