Skip to content

Instantly share code, notes, and snippets.

@jeffrymorris
Created October 17, 2017 23:52
Show Gist options
  • Save jeffrymorris/89b7119f2049c4945ce663a850d7e37e to your computer and use it in GitHub Desktop.
Save jeffrymorris/89b7119f2049c4945ce663a850d7e37e to your computer and use it in GitHub Desktop.
[1:58 PM] Brett Lawson: Would you be able to show me what Java authentication looked like pre-cluster-level-auth, post-cluster-level-auth and post-rbac? [1:58 PM] Brett Lawson: .NET***
//cluster-level authentication
var authenticator = new ClassicAuthenticator("Administrator", "password");
authenticator.AddBucketCredential("authenticated", "secret");
var cluster = new Cluster();
cluster.Authenticate(authenticator);
var bucket = cluster.OpenBucket("authenticated");
//RBAC authentication
var authenticator = new PasswordAuthenticator("Administrator", "password");
var cluster = new Cluster();
cluster.Authenticate(authenticator);
var bucket = cluster.OpenBucket("authenticated");
//old-skool authentication
var cluster = new Cluster();
var bucket = cluster.OpenBucket("authenticated", "secret");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment