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"); ?>