{"id":2129,"date":"2016-01-19T09:10:04","date_gmt":"2016-01-19T09:10:03","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2129"},"modified":"2016-01-19T09:10:04","modified_gmt":"2016-01-19T09:10:03","slug":"how-to-authorize-users-in-sync-gateway","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/","title":{"rendered":"How to Authorize Users in Sync Gateway"},"content":{"rendered":"<p style=\"text-align: justify;\"><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2016\/january\/how-to-authorize-users-in-sync-gateway\/screen-shot-2016-01-19-at-3.00.04-am.png\" \/><\/p>\n<p style=\"text-align: justify;\">To kick off the Couchbase Mobile Sync Gateway series, we will begin with understanding on how to authenticate and authorize users in <a href=\"https:\/\/bit.ly\/sync_gateway\">Sync Gateway<\/a> which is the intermediary component between mobile apps and Couchbase Server.<\/p>\n<p style=\"text-align: justify;\">Through Sync Gateway, there are various ways you may authenticate your user base for your mobile application in order to then authorize them to access the remote database.\u00a0 From there onwards, mobile apps can communicate data by replication where data can have bi-directional and multi-master sync.\u00a0 Let us explore the different <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/guides\/sync-gateway\/administering-sync-gateway\/authenticating-users\/index.html\">Authentication Users<\/a> mechanisms first.<\/p>\n<h2 style=\"text-align: justify;\">Authentication \u00a0<\/h2>\n<h3>HTTP Basic Authentication<\/h3>\n<p style=\"text-align: justify;\">The mobile client is able to authenticate through Sync Gateway by using either a session URL where it is determined to be \/dbname\/_session or using a cookie-based session.<\/p>\n<pre>\n<code class=\"bash language-bash\">curl -H \"Content-type: application\/json\" -X POST \nhttps:\/\/localhost:4984\/dbname\/_session --data \n\"{\"name\":\"userID\",\"password\":\"pw\"}\"<\/code><\/pre>\n<p style=\"text-align: justify;\">With the user credentials provided in the session URL POST request, the validation will return the following upon a correct user and password set<\/p>\n<pre>\n<code class=\"bash language-json\">{\n    \"authentication_handlers\":[\"default\",\"cookie\"],\n    \"ok\":true,\n    \"userCtx\":{\"channels\":{\"!\":1,\"channel1\":1,\"channel2\":1},\"name\":\"userID\"}\n}<\/code><\/pre>\n<h3>Pluggable Authentication<\/h3>\n<p style=\"text-align: justify;\">For Couchbase Mobile, the Facebook Authentication method is a pluggable authentication option where Sync Gateway will be communicating to Facebook to authenticate the token for the clients.\u00a0 For us to enable this feature, the top-level property &apos;facebook&apos; is set to true in the server configuration file for the &apos;register&apos; key like below.<\/p>\n<pre>\n<code class=\"bash language-json\">{\n    \"facebook\" : { \"register\" : true },\n    \"databases\": {\n        \"grocery-sync\": {\n            \u201cserver\u201d:\u201dhttps:\/\/cbserver:8091\u201d,\n            \u201cbucket\":\"grocery-sync\",\n            \"users\": {\"GUEST\": {\"disabled\": true}},\n            \"sync\":`function(doc) {channel(doc.channels);}`\n        }\n    }\n}<\/code><\/pre>\n<p style=\"text-align: justify;\">From there, the mobile client can implicitly register new user accounts by authenticating through Facebook with a POST request to &apos;\/dbname\/_facebook&apos; and return a JSON that contains:<\/p>\n<ul style=\"margin-left: 40px;\">\n<li style=\"text-align: justify;\"><strong>access_token<\/strong>:\u00a0 Access token returned by Facebook<\/li>\n<li style=\"text-align: justify;\"><strong>email<\/strong>: User email<\/li>\n<li style=\"text-align: justify;\"><strong>remote_url<\/strong>: Sync Gateway Endpoint<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u00a0<\/p>\n<p style=\"text-align: justify;\">The user name for the account is the same as the authenticated email address along with a random password. \u00a0\u00a0<\/p>\n<h3>Custom Authentication<\/h3>\n<p style=\"text-align: justify;\">There are a couple of advantages of having a custom auth for your mobile application in that you do not need to be dependent in 3rd party solutions like the previous pluggable Facebook method.\u00a0 There is overall more work involved where you have to maintain the service that communicates with the Sync Gateway along with the respective end point calls from the mobile app.\u00a0 This will be dependent if you have an existing user base in like an <a href=\"https:\/\/en.wikipedia.org\/wiki\/Lightweight_Directory_Access_Protocol\">LDAP server<\/a> or that the client may need to have the feature to create an user name and password combination.\u00a0<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2016\/january\/how-to-authorize-users-in-sync-gateway\/screen-shot-2016-01-19-at-2.20.58-am.png\" \/><\/p>\n<p>\u00a0<\/p>\n<p style=\"text-align: justify;\"><span style=\"color: rgb(74, 73, 71); font-family: &apos;Helvetica Neue&apos;; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: auto; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);\">To implement a custom provider where an user base exists in an LDAP server setup is where the mobile application points to the app or auth server first.\u00a0 The auth server is then responsible for authenticating users where once it successfuly authenticates an user, the auth server would make an API call to Sync Gateway <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/references\/sync-gateway\/admin-rest-api\/index.html\">Admin REST API<\/a> in the second step to get a valid session for that user by sending a POST request to &apos;<a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/references\/sync-gateway\/admin-rest-api\/session\/index.html\">\/dbname\/_session<\/a>&apos; endpoint.\u00a0 That session token then gets routed back to the auth server and then returned back to the mobile client.\u00a0 The third and last step once the mobile application obtains the token is then to communicate to Sync Gateway directly using the session token to obtain all the data required for the user on the device.<\/span><\/p>\n<p>\u00a0<\/p>\n<p>Once we have authenticated our users, it is time explore the different <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/guides\/sync-gateway\/administering-sync-gateway\/authorizing-users\/index.html\">Authorizing Users<\/a> mechanisms next.\u00a0<\/p>\n<h2>Authorization<\/h2>\n<h3>Accounts:\u00a0 admin_channels<\/h3>\n<p style=\"text-align: justify;\">Sync Gateway allows for authorizing certain users the right to particular documents within a database.\u00a0 Through the <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/guides\/sync-gateway\/configuring-sync-gateway\/index.html\">JSON configuration file<\/a>, which defines Sync Gateway properties, we are able to use the &apos;admin_channels&apos; feature to enable a list of channels where the user has access to once they are authenticated.\u00a0 Authorizing an user to a particular channel would allow document READ access:<\/p>\n<pre>\n<code class=\"bash language-json\">{\n    \"log\" : [\u201c*\u201d],\n    \"databases\": {\n        \"grocery-sync\": {\n            \u201cserver\u201d:\u201dwalrus:\u201d,\n            \u201cbucket\":\"grocery-sync\",\n            \"users\": {\n              \u201calice\u201d: {\n                \u201cdisabled\u201d : false,\n                \u201cpassword\u201d: \u201cpassword\u201d,\n                \u201cadmin_channels\u201d:[\u201citems-alice\u201d] \n              },    \n              \u201cbob\u201d: {\n                \u201cdisabled\u201d : false,\n                \u201cpassword\u201d: \u201cpassword\u201d,\n                \u201cadmin_channels\u201d:[\u201c*\u201d] \n              },\n         \n            \u201csync\u201d : \u2018\n              function(doc, oldDoc) {\n                channel(\u201citems-\u201d+doc.owner);  }\n                 \/\/Add item document to owner\u2019s items channel\n              \u2018\n           }\n        }\n     }\n}\n<\/code><\/pre>\n<p style=\"text-align: justify;\">In the example above, the * Star channel is a special channel that provides administraton privileges for a particular user, Bob, where Bob is granted open ended access to all the documents within a database.\u00a0 Alice on the other hand will have access to her own items channel that is specific to &apos;items-alice&apos; tag and therefore in the authorization scheme, Alice is then authorized.\u00a0 To enable the authorization to occur, the owner field in a grocery item document needs to be linked to the\u00a0<span style=\"color: rgb(74, 73, 71); font-family: &apos;Helvetica Neue&apos;; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: auto; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);\">owner personal items channel accordingly.<\/span> \u00a0 \u00a0<\/p>\n<p style=\"text-align: justify;\">The Sync Function will enable the ability for users to submit revisions to documents by checking if the users are authorized to access the document.\u00a0 How that is done is by assigning Account properties like &apos;password&apos; above in the example or &apos;roles&apos; to the users where authorized users can then access Sync Gateway and control their remote database.\u00a0 The &apos;admin_channel&apos; and &apos;password&apos; are two of the available <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/guides\/sync-gateway\/administering-sync-gateway\/authorizing-users\/index.html\">Account properties<\/a> that can be used to authorize user access to the remote database through Sync Gateway.\u00a0<\/p>\n<p style=\"text-align: justify;\">In the follow up Sync Gateway blog series, we will explore how &apos;<a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/develop\/guides\/sync-gateway\/channels\/intro\/index.html\">Channels<\/a>&apos; enable particular users to be able to read a document in the database and learn how data is routed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To kick off the Couchbase Mobile Sync Gateway series, we will begin with understanding on how to authenticate and authorize users in Sync Gateway which is the intermediary component between mobile apps and Couchbase Server. Through Sync Gateway, there are [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1810],"tags":[],"ppma_author":[8983],"class_list":["post-2129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-mobile"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Authorize Users in Sync Gateway - The Couchbase Blog<\/title>\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\/how-to-authorize-users-in-sync-gateway\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Authorize Users in Sync Gateway\" \/>\n<meta property=\"og:description\" content=\"To kick off the Couchbase Mobile Sync Gateway series, we will begin with understanding on how to authenticate and authorize users in Sync Gateway which is the intermediary component between mobile apps and Couchbase Server. Through Sync Gateway, there are [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-01-19T09:10:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/\"},\"author\":{\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32\"},\"headline\":\"How to Authorize Users in Sync Gateway\",\"datePublished\":\"2016-01-19T09:10:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/\"},\"wordCount\":813,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Mobile\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/\",\"name\":\"How to Authorize Users in Sync Gateway - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2016-01-19T09:10:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Authorize Users in Sync Gateway\"}]},{\"@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\/425717456c198fdf9aaa5d7a6d42ad32\",\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"caption\":\"William Hoang, Mobile Developer Advocate, Couchbase\"},\"description\":\"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Authorize Users in Sync Gateway - The Couchbase Blog","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\/how-to-authorize-users-in-sync-gateway\/","og_locale":"en_US","og_type":"article","og_title":"How to Authorize Users in Sync Gateway","og_description":"To kick off the Couchbase Mobile Sync Gateway series, we will begin with understanding on how to authenticate and authorize users in Sync Gateway which is the intermediary component between mobile apps and Couchbase Server. Through Sync Gateway, there are [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/","og_site_name":"The Couchbase Blog","article_published_time":"2016-01-19T09:10:03+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"William Hoang, Mobile Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"William Hoang, Mobile Developer Advocate, Couchbase","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/"},"author":{"name":"William Hoang, Mobile Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32"},"headline":"How to Authorize Users in Sync Gateway","datePublished":"2016-01-19T09:10:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/"},"wordCount":813,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Mobile"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/","url":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/","name":"How to Authorize Users in Sync Gateway - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2016-01-19T09:10:03+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/how-to-authorize-users-in-sync-gateway\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Authorize Users in Sync Gateway"}]},{"@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\/425717456c198fdf9aaa5d7a6d42ad32","name":"William Hoang, Mobile Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5","url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","caption":"William Hoang, Mobile Developer Advocate, Couchbase"},"description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering","url":"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/"}]}},"authors":[{"term_id":8983,"user_id":30,"is_guest":0,"slug":"william-hoang","display_name":"William Hoang, Mobile Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","author_category":"","last_name":"Hoang","first_name":"William","job_title":"","user_url":"","description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering"}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2129","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\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2129"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2129\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2129"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}