{"id":3655,"date":"2017-05-31T13:31:31","date_gmt":"2017-05-31T20:31:31","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=3655"},"modified":"2025-06-13T19:29:01","modified_gmt":"2025-06-14T02:29:01","slug":"authentication-authorization-rbac-net","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/","title":{"rendered":"Authentication and Authorization with RBAC in .NET"},"content":{"rendered":"<div class=\"paragraph\">\n<p>Authentication and authorization are vastly improved in Couchbase Server 5.0. We\u2019ve been blogging about the new RBAC features in the developer preview for a while.<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac\/\">Authentication and Authorization with RBAC<\/a> &#8211; introduction \/ part 1<\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-part-2\/\">Authentication and Authorization with RBAC (Part 2)<\/a> &#8211; managing users<\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/new-sdk-authentication\/\">Improved SDK Authentication Methods &#8211; Couchbase 5.0<\/a> &#8211; an introduction featuring Python, Java, PHP, and .NET<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Now that Couchbase Server 5.0 Beta is released, I\u2019m writing a more in-depth blog post about how to use the Couchbase .NET SDK along with these new features.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><em>The full code samples used in this blog post are <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/067RBACandSDK\/src\/rbacsdk\">available for you on Github<\/a>.<\/em><\/p>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_create_a_bucket\">Create a bucket<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>As I mentioned in the previous posts, the days of buckets with passwords are gone. The future belongs to users\u2014\u200busers that have specific permission(s) to specific bucket(s).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Let\u2019s start by creating a bucket. In the Couchbase UI, login as the Administrator that you created when you installed Couchbase. Go to &#8220;Buckets&#8221; and click &#8220;ADD BUCKET&#8221; (top right). You will see the &#8220;Add Data Bucket&#8221; dialog. Notice that there is no longer a &#8220;password&#8221; field (not even in &#8220;Advanced bucket settings&#8221;).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/05\/06701-add-new-bucket.png\" alt=\"Add new bucket - no authentication options anymore\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Give the bucket a name and some amount of memory, and click &#8220;Add Bucket&#8221;. Now you have a bucket. But, other than an Administrator in the UI, no one can access this bucket yet.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_create_a_user\">Create a user<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>In order to get access to this bucket, you must create a user. In Couchbase 5.0, &#8220;users&#8221; are an entirely new feature, bringing richer authentication and authorization features to Couchbase Server.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>While still logged in as an administrator, go to &#8220;Security&#8221; to see a list of users. Click &#8220;ADD USER&#8221; (top right).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/05\/06702-add-new-user-for-authentication.png\" alt=\"Adding a new user for authentication and authorization\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Create a user with whatever name and password you\u2019d like. You can choose which roles the user has, and for which buckets (when applicable). Let\u2019s give this user Data Writer and Data Reader roles, for the bucket that was just created (e.g. &#8220;mybucket&#8221;), but NOT any Query roles.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/05\/06703-add-data-roles.png\" alt=\"Adding authorization for data read and data write\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Once the user is added, you can hover over the roles to get a description of what the role means.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/05\/06704-tool-tip-authorization.gif\" alt=\"Authorization tool tip\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_authentication_and_authorization_with_the_couchbase_net_sdk\">Authentication and authorization with the Couchbase .NET SDK<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Now that we have a bucket and a user, let\u2019s see how to use them with the .NET SDK.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Start by creating a <code>Cluster<\/code> object.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">var cluster = new Cluster(new ClientConfiguration\r\n{\r\n    Servers = new List&lt;Uri&gt; { new Uri(\"https:\/\/localhost:8091\") }\r\n});<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>You have a cluster, but your program has not been authenticated yet. Use a <code>PasswordAuthenticator<\/code> object to specify the credentials. Then, use that object with the cluster\u2019s <code>Authenticate<\/code> method. In this example below, I\u2019m using incorrect credentials.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">var authenticator = new PasswordAuthenticator(\"myuser\", \"wrongpassword\");\r\ncluster.Authenticate(authenticator);<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>Now, if I try to perform an operation like <code>OpenBucket<\/code> on the cluster, an exception is thrown.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">try\r\n{\r\n    var bucket = cluster.OpenBucket(\"mybucket\");\r\n}\r\ncatch (Exception ex)\r\n{\r\n    Console.WriteLine(\"Error getting bucket.\");\r\n    Console.WriteLine(ex.Message);\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/05\/06705-authentication-error.png\" alt=\"Error in authentication\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Now, let\u2019s try it again using the correct credentials. Authentication will work. But let\u2019s talk about authorization next.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Remember that I only gave this user Data Writer and Data Reader roles (for mybucket). So, if I authenticate and insert a document now, it works.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">var cluster = new Cluster(new ClientConfiguration\r\n{\r\n    Servers = new List&lt;Uri&gt; { new Uri(\"https:\/\/localhost:8091\") }\r\n});\r\nvar authenticator = new PasswordAuthenticator(\"myuser\", \"password\");\r\ncluster.Authenticate(authenticator);\r\nvar bucket = cluster.OpenBucket(\"mybucket\");\r\n\r\n\/\/ insert a document, this should be allowed\r\nvar result = bucket.Insert(Guid.NewGuid().ToString(), new {foo = \"bar\"});\r\nConsole.WriteLine(\"Insert was successful: \" + result.Success);<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/05\/06706-console-output-authorization.png\" alt=\"Console output when authentication and authorization are valid\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>But if I tried to, for instance, execute a <a href=\"https:\/\/www.couchbase.com\/products\/n1ql\/\">N1QL (SQL for JSON) query<\/a>, then it would fail. This is because that user is not authorized to execute queries.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">var queryResult = bucket.Query&lt;int&gt;(\"SELECT COUNT(1) FROM `\" + bucket.Name + \"`\");\r\nConsole.WriteLine(\"Query was successful: \" + queryResult.Success);\r\nqueryResult.Errors.ForEach(e =&gt; Console.WriteLine(\"Error: \" + e.Message));<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>I\u2019m just doing a simple <code>COUNT(1)<\/code> aggregation query. Since that user is not authorized, here\u2019s what\u2019s displayed:<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/05\/06707-authorization-query.png\" alt=\"No authorization for running a query\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_one_more_thing\">One more thing<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>If you are worried about the effect this will have on upgrading from Couchbase Server 4.x to Couchbase Server 5.0, then here\u2019s a tip. If you create a user with the same name as the bucket (e.g. a bucket called &#8220;foo&#8221; and a user named &#8220;foo&#8221;), then the older Couchbase .NET APIs that still expect a bucket password will work as before. Just give that user a &#8220;Cluster Admin&#8221; role for now. This is a good temporary fix until you can re-engineer your system to use a regimented approach to role.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_summary\">Summary<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Couchbase Server 5.0 is out now in beta! These role-based authentication (RBAC) features make Couchbase a leader in document database security, and I\u2019m personally very pleased that Couchbase is going in this direction. Security is important, but too often overlooked by developers.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you have any questions, please <a href=\"https:\/\/www.couchbase.com\/forums\/\">ask away in the Couchbase Forums<\/a>, leave a comment below, or <a href=\"https:\/\/twitter.com\/mgroves\">ping me on Twitter @mgroves<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Authentication and authorization are vastly improved in Couchbase Server 5.0. We\u2019ve been blogging about the new RBAC features in the developer preview for a while. Authentication and Authorization with RBAC &#8211; introduction \/ part 1 Authentication and Authorization with RBAC [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":3004,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1811,1816,1813],"tags":[1455,1456,1903],"ppma_author":[8937],"class_list":["post-3655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-couchbase-server","category-security","tag-authentication","tag-authorization","tag-rbac"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Authentication and Authorization with RBAC in .NET - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Examples of using the Couchbase .NET SDK with the new authentication and authorization features of Couchbase Server 5.0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Authentication and Authorization with RBAC in .NET\" \/>\n<meta property=\"og:description\" content=\"Examples of using the Couchbase .NET SDK with the new authentication and authorization features of Couchbase Server 5.0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-31T20:31:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:29:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1125\" \/>\n\t<meta property=\"og:image:height\" content=\"750\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matthew Groves\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mgroves\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Groves\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/\"},\"author\":{\"name\":\"Matthew Groves\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\"},\"headline\":\"Authentication and Authorization with RBAC in .NET\",\"datePublished\":\"2017-05-31T20:31:31+00:00\",\"dateModified\":\"2025-06-14T02:29:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/\"},\"wordCount\":694,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg\",\"keywords\":[\"authentication\",\"authorization\",\"RBAC\"],\"articleSection\":[\".NET\",\"Couchbase Server\",\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/\",\"name\":\"Authentication and Authorization with RBAC in .NET - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg\",\"datePublished\":\"2017-05-31T20:31:31+00:00\",\"dateModified\":\"2025-06-14T02:29:01+00:00\",\"description\":\"Examples of using the Couchbase .NET SDK with the new authentication and authorization features of Couchbase Server 5.0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg\",\"width\":1125,\"height\":750,\"caption\":\"NoSQL has built-in security with Couchbase\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication and Authorization with RBAC in .NET\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\",\"name\":\"Matthew Groves\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"caption\":\"Matthew Groves\"},\"description\":\"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.\",\"sameAs\":[\"https:\/\/crosscuttingconcerns.com\",\"https:\/\/x.com\/mgroves\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Authentication and Authorization with RBAC in .NET - The Couchbase Blog","description":"Examples of using the Couchbase .NET SDK with the new authentication and authorization features of Couchbase Server 5.0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/","og_locale":"en_US","og_type":"article","og_title":"Authentication and Authorization with RBAC in .NET","og_description":"Examples of using the Couchbase .NET SDK with the new authentication and authorization features of Couchbase Server 5.0","og_url":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-05-31T20:31:31+00:00","article_modified_time":"2025-06-14T02:29:01+00:00","og_image":[{"width":1125,"height":750,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg","type":"image\/jpeg"}],"author":"Matthew Groves","twitter_card":"summary_large_image","twitter_creator":"@mgroves","twitter_misc":{"Written by":"Matthew Groves","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/"},"author":{"name":"Matthew Groves","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58"},"headline":"Authentication and Authorization with RBAC in .NET","datePublished":"2017-05-31T20:31:31+00:00","dateModified":"2025-06-14T02:29:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/"},"wordCount":694,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg","keywords":["authentication","authorization","RBAC"],"articleSection":[".NET","Couchbase Server","Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/","url":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/","name":"Authentication and Authorization with RBAC in .NET - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg","datePublished":"2017-05-31T20:31:31+00:00","dateModified":"2025-06-14T02:29:01+00:00","description":"Examples of using the Couchbase .NET SDK with the new authentication and authorization features of Couchbase Server 5.0","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/059-Hero-Key-Locks-Security-Authentication-Authorization-e1657658890360.jpeg","width":1125,"height":750,"caption":"NoSQL has built-in security with Couchbase"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/authentication-authorization-rbac-net\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Authentication and Authorization with RBAC in .NET"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58","name":"Matthew Groves","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54","url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","caption":"Matthew Groves"},"description":"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.","sameAs":["https:\/\/crosscuttingconcerns.com","https:\/\/x.com\/mgroves"],"url":"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/"}]}},"authors":[{"term_id":8937,"user_id":71,"is_guest":0,"slug":"matthew-groves","display_name":"Matthew Groves","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","author_category":"","last_name":"Groves","first_name":"Matthew","job_title":"","user_url":"https:\/\/crosscuttingconcerns.com","description":"Matthew D. Groves is a guy who loves to code.  It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything.  He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s.  He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community.  He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=3655"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3655\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/3004"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=3655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=3655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=3655"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}