1"use strict";(self.webpackChunkglean_developer_site=self.webpackChunkglean_developer_site||[]).push([["174"],{60021(e,t,n){n.r(t),n.d(t,{metadata:()=>a,default:()=>h,frontMatter:()=>o,contentTitle:()=>r,toc:()=>c,assets:()=>d});var a=JSON.parse('{"id":"api-info/indexing/custom-metadata/authentication","title":"Authentication","description":"Custom Metadata requests require a Bearer token in the Authorization header. Tokens are scoped, so metadata-management permissions can be delegated independently of full indexing-token access.","source":"@site/docs/api-info/indexing/custom-metadata/authentication.mdx","sourceDirName":"api-info/indexing/custom-metadata","slug":"/api-info/indexing/custom-metadata/authentication","permalink":"/api-info/indexing/custom-metadata/authentication","draft":false,"unlisted":false,"editUrl":"https://github.com/gleanwork/glean-developer-site/edit/main/docs/api-info/indexing/custom-metadata/authentication.mdx","tags":[],"version":"current","frontMatter":{"title":"Authentication","icon":"key-skeleton-left-right"},"sidebar":"docSidebar","previous":{"title":"Overview","permalink":"/api-info/indexing/custom-metadata/overview"},"next":{"title":"Schema Management","permalink":"/api-info/indexing/custom-metadata/schema-management"}}'),i=n(11684),s=n(32435);let o={title:"Authentication",icon:"key-skeleton-left-right"},r,d={},c=[{value:"Token scopes",id:"token-scopes",level:2},{value:"Choosing a scope",id:"choosing-a-scope",level:2},{value:"Using the token",id:"using-the-token",level:2}];function l(e){let t={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Custom Metadata requests require a Bearer token in the ",(0,i.jsx)(t.code,{children:"Authorization"})," header. Tokens are ",(0,i.jsx)(t.strong,{children:"scoped"}),", so metadata-management permissions can be delegated independently of full indexing-token access."]}),"\n",(0,i.jsx)(t.h2,{id:"token-scopes",children:"Token scopes"}),"\n",(0,i.jsxs)(t.p,{children:["When creating a token via the ",(0,i.jsx)(t.a,{href:"/api-info/indexing/authentication/overview",children:"indexing token creation flow"}),", set the scope to one of:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Global scope"})," \u2014 ",(0,i.jsx)(t.code,{children:"custommetadata:global_scope"}),". Manages schemas and metadata for ",(0,i.jsx)(t.strong,{children:"any"})," group."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Group-specific scope"})," \u2014 ",(0,i.jsx)(t.code,{children:"custommetadata:<group_name>"}),". Manages the schema and metadata for the named group only."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A group-scoped token can manage metadata for that group across any document in Glean \u2014 it is not tied to a particular datasource."}),"\n",(0,i.jsx)(t.h2,{id:"choosing-a-scope",children:"Choosing a scope"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Scenario"}),(0,i.jsx)(t.th,{children:"Recommended scope"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"One pipeline managing several metadata groups"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"custommetadata:global_scope"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Per-team or per-integration metadata pipelines that should be isolated"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"custommetadata:<group_name>"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Third-party or partner integrations"}),(0,i.jsxs)(t.td,{children:[(0,i.jsx)(t.code,{children:"custommetadata:<group_name>"})," (least privilege)"]})]})]})]}),"\n",(0,i.jsx)(t.h2,{id:"using-the-token",children:"Using the token"}),"\n",(0,i.jsx)(t.p,{children:"Include the token as a Bearer credential on every request:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",metastring:"snippet=authentication/snippet-01.sh",children:"curl -H 'Authorization: Bearer <token>' \\\n https://<glean-instance-name>-be.glean.com/rest/api/index/custom-metadata/schema/<groupName>\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Requests made with a token whose scope does not cover the target group return ",(0,i.jsx)(t.code,{children:"401 Unauthorized"}),"."]})]})}function h(e={}){let{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.