[{"data":1,"prerenderedAt":495},["ShallowReactive",2],{"docs-\u002Fauth\u002F":3},{"id":4,"title":5,"body":6,"breadcrumb":456,"coderail":463,"dateModified":479,"datePublished":479,"description":480,"extension":481,"meta":482,"navigation":483,"next":484,"path":487,"prev":488,"schemaType":490,"seo":491,"stem":492,"wide":493,"__hash__":494},"docs\u002Fauth.md","Authentication",{"type":7,"value":8,"toc":446},"minimark",[9,18,44,50,55,58,138,141,145,172,179,182,189,197,200,203,213,216,230,234,311,314,318,325,434],[10,11,12,13,17],"p",{},"API requests carry a bearer token in the ",[14,15,16],"code",{},"Authorization"," header. The same header works on the REST API and on the MCP endpoint.",[10,19,20,21,24,25,28,29,32,33,36,37,40,41,43],{},"A few requests need no token: a CORS preflight (",[14,22,23],{},"OPTIONS","), ",[14,26,27],{},"GET \u002Fmcp"," (it returns the server name and protocol version), and the MCP handshake messages ",[14,30,31],{},"initialize",", ",[14,34,35],{},"notifications\u002Finitialized"," and ",[14,38,39],{},"ping"," when they are sent with no ",[14,42,16],{}," header.",[45,46],"endpoint-bar",{"base-color":47,"method":48,"path":49},"ink","HEADER","Authorization: Bearer \u003Ctoken>",[51,52,54],"h2",{"id":53},"paths","Token kinds",[10,56,57],{},"TagManifest accepts three kinds of token.",[59,60,61,80],"table",{},[62,63,64],"thead",{},[65,66,67,71,74,77],"tr",{},[68,69,70],"th",{},"Token",[68,72,73],{},"Who issues it",[68,75,76],{},"Lifetime",[68,78,79],{},"Used for",[81,82,83,107,124],"tbody",{},[65,84,85,93,101,104],{},[86,87,88,89,92],"td",{},"API key (",[14,90,91],{},"tm_…",")",[86,94,95,96],{},"You, on the ",[97,98,100],"a",{"href":99},"\u002Faccount\u002F","account page",[86,102,103],{},"Until you revoke it",[86,105,106],{},"REST calls, and MCP clients that take a header in their config",[65,108,109,112,118,121],{},[86,110,111],{},"MCP access token",[86,113,114,115],{},"TagManifest's own OAuth server, at ",[14,116,117],{},"\u002Foauth\u002Ftoken",[86,119,120],{},"1 hour, then refreshed",[86,122,123],{},"MCP clients that sign in through the browser, such as Claude.ai",[65,125,126,129,132,135],{},[86,127,128],{},"Account session token",[86,130,131],{},"The Google sign-in on the account page",[86,133,134],{},"Managed by the account page",[86,136,137],{},"Creating, listing and revoking API keys",[10,139,140],{},"Most integrations need only an API key.",[51,142,144],{"id":143},"api-key","API key",[146,147,148,155,158,165],"ol",{},[149,150,151,152,154],"li",{},"Sign in on the ",[97,153,100],{"href":99}," and create a key. An account can hold up to five active keys.",[149,156,157],{},"Copy the plaintext key. It is shown once and is not stored.",[149,159,160,161,164],{},"Keep it in ",[14,162,163],{},"TM_API_KEY"," or in your client's MCP config.",[149,166,167,168,171],{},"Send ",[14,169,170],{},"Authorization: Bearer tm_…"," on every request.",[10,173,174,175,178],{},"Keys are 51 characters: ",[14,176,177],{},"tm_"," followed by 48 hex characters (24 random bytes). The backend stores a SHA-256 hash, so a lost key cannot be recovered. Revoke it and create a new one.",[51,180,111],{"id":181},"mcp-token",[10,183,184,185,188],{},"MCP clients that support OAuth get their token from TagManifest's own OAuth 2.1 server. The client registers itself, sends the user through Google sign-in and a consent screen, and receives a short-lived access token plus a refresh token. It renews the access token at ",[14,186,187],{},"POST \u002Foauth\u002Ftoken",".",[10,190,191,192,196],{},"The client does all of this for you. The full flow, for anyone writing their own MCP client, is on the ",[97,193,195],{"href":194},"\u002Fmcp\u002Foauth\u002F","OAuth flow"," page.",[10,198,199],{},"An MCP access token carries the scopes the user approved. It also works on the REST endpoints, within those scopes.",[51,201,128],{"id":202},"session",[10,204,205,206,208,209,212],{},"The ",[97,207,100],{"href":99}," signs you in with Google and holds a session token in the browser. That token is what the page sends to ",[14,210,211],{},"\u002Fv1\u002Fapi-keys"," to create, list and revoke keys.",[10,214,215],{},"Its job is key management, and the account page handles it for you: manage keys on the page. The token carries both scopes, so the scan and rule endpoints and the MCP endpoint accept it too. Do not build on that. It belongs to the browser session and its lifetime is managed by the account page. API keys and MCP sign-in are the supported ways in.",[217,218,220],"callout",{"variant":219},"warn",[10,221,222,226,227,229],{},[223,224,225],"strong",{},"API keys and MCP access tokens can't manage API keys."," The ",[14,228,211],{}," endpoints accept only the account session token. An API key, or a valid MCP access token, gets a 403. A token that is expired or not recognised gets a 401. A leaked key, or a token held by an MCP client, cannot create more keys.",[51,231,233],{"id":232},"scopes","Scopes",[59,235,236,246],{},[62,237,238],{},[65,239,240,243],{},[68,241,242],{},"Scope",[68,244,245],{},"Allows",[81,247,248,273],{},[65,249,250,255],{},[86,251,252],{},[14,253,254],{},"mcp:read",[86,256,257,32,260,263,264,32,267,32,270],{},[14,258,259],{},"GET \u002Fv1\u002Frules",[14,261,262],{},"GET \u002Fv1\u002Frules-detail",", and the tools ",[14,265,266],{},"list_rules",[14,268,269],{},"get_rule",[14,271,272],{},"account_status",[65,274,275,280],{},[86,276,277],{},[14,278,279],{},"mcp:tools",[86,281,282,283,285,286,32,289,32,292,295,296,32,299,32,302,32,305,32,308],{},"Everything in ",[14,284,254],{},", plus ",[14,287,288],{},"POST \u002Fv1\u002Fscan-url",[14,290,291],{},"POST \u002Fv1\u002Fscan",[14,293,294],{},"POST \u002Fv1\u002Fevaluate-rule"," and the tools ",[14,297,298],{},"scan_url",[14,300,301],{},"scan_container",[14,303,304],{},"evaluate_rule",[14,306,307],{},"get_health_score",[14,309,310],{},"compare_containers",[10,312,313],{},"API keys and account session tokens carry both scopes. An MCP access token carries what the user approved at sign-in.",[51,315,317],{"id":316},"errors","Authentication errors",[10,319,320,321,324],{},"Auth failures return HTTP 401, or 403 for a token that is valid but not allowed. The body is JSON with an ",[14,322,323],{},"error"," string.",[59,326,327,341],{},[62,328,329],{},[65,330,331,334,338],{},[68,332,333],{},"Status",[68,335,336],{},[14,337,323],{},[68,339,340],{},"Cause",[81,342,343,362,377,389,406,420],{},[65,344,345,348,353],{},[86,346,347],{},"401",[86,349,350],{},[14,351,352],{},"Missing or malformed Authorization header",[86,354,355,356,358,359,188],{},"No ",[14,357,16],{}," header, or it does not start with ",[14,360,361],{},"Bearer ",[65,363,364,366,371],{},[86,365,347],{},[86,367,368],{},[14,369,370],{},"Invalid or revoked API key",[86,372,373,374,376],{},"A ",[14,375,177],{}," key that is unknown or revoked.",[65,378,379,381,386],{},[86,380,347],{},[86,382,383],{},[14,384,385],{},"Invalid or expired token",[86,387,388],{},"An MCP access token or session token that is malformed, expired or not recognised.",[65,390,391,394,399],{},[86,392,393],{},"403",[86,395,396],{},[14,397,398],{},"insufficient_scope",[86,400,401,402,405],{},"An MCP access token without the scope the endpoint needs. A ",[14,403,404],{},"message"," field names the scope.",[65,407,408,410,415],{},[86,409,393],{},[86,411,412],{},[14,413,414],{},"API keys cannot manage API keys — use a session JWT",[86,416,417,418,188],{},"An API key sent to ",[14,419,211],{},[65,421,422,424,429],{},[86,423,393],{},[86,425,426],{},[14,427,428],{},"MCP access tokens cannot manage API keys — use a session JWT",[86,430,431,432,188],{},"An MCP access token sent to ",[14,433,211],{},[10,435,436,437,440,441,445],{},"On the MCP endpoint a 401 also carries a ",[14,438,439],{},"WWW-Authenticate"," header that points the client at the OAuth metadata, so it can sign in again. See ",[97,442,444],{"href":443},"\u002Ferrors\u002F","Errors"," for the full list.",{"title":447,"searchDepth":448,"depth":448,"links":449},"",2,[450,451,452,453,454,455],{"id":53,"depth":448,"text":54},{"id":143,"depth":448,"text":144},{"id":181,"depth":448,"text":111},{"id":202,"depth":448,"text":128},{"id":232,"depth":448,"text":233},{"id":316,"depth":448,"text":317},[457,460,462],{"label":458,"href":459},"API Reference","\u002F",{"label":461},"Getting started",{"label":5},{"cards":464,"onpage":472},[465],{"title":466,"tabs":467},"Header",[468],{"label":469,"language":470,"code":471},"request","bash","# API key (servers, scripts, MCP clients with a config file)\nAuthorization: Bearer tm_a1b2c3d4e5f6789a…\n\n# MCP access token (issued by the OAuth flow)\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIs…\n",[473,474,475,476,477,478],{"id":53,"label":54},{"id":143,"label":144},{"id":181,"label":111},{"id":202,"label":128},{"id":232,"label":233},{"id":316,"label":317},null,"Bearer-token auth. Three kinds of token are accepted - an API key, an MCP access token from the OAuth flow, and the account page's session token.","md",{},true,{"href":485,"title":486},"\u002Fmcp\u002Fconnect\u002F","Connect to Claude","\u002Fauth",{"href":459,"title":489},"Introduction","TechArticle",{"title":5,"description":480},"auth",false,"8OX4I2YpJV3g_JwCoT2gWvu_cFu8N28ohCPHGN9X5fE",1796069482180]