{"title":"Lakehouse credentials","description":"Altertable generates secure credentials for each environment. Access them to connect via the HTTP API, Arrow Flight SQL, or Postgres adapter.","order":300,"askSuggestions":["Why does authentication fail with my lakehouse credentials?","How do I connect a Postgres client with these credentials?"],"navigation":true,"routeId":"lakehouseAuthentication","body":{"code":"var Component=(()=>{var p=Object.create;var s=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),w=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},l=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let i of g(e))!A.call(t,i)&&i!==r&&s(t,i,{get:()=>e[i],enumerable:!(o=f(e,i))||o.enumerable});return t};var k=(t,e,r)=>(r=t!=null?p(m(t)):{},l(e||!t||!t.__esModule?s(r,\"default\",{value:t,enumerable:!0}):r,t)),x=t=>l(s({},\"__esModule\",{value:!0}),t);var h=T((v,a)=>{a.exports=_jsx_runtime});var L={};w(L,{default:()=>u,frontmatter:()=>y});var n=k(h()),y={title:\"Lakehouse credentials\",routeId:\"lakehouseAuthentication\",description:\"Altertable generates secure credentials for each environment. Access them to connect via the HTTP API, Arrow Flight SQL, or Postgres adapter.\",order:300,askSuggestions:[\"Why does authentication fail with my lakehouse credentials?\",\"How do I connect a Postgres client with these credentials?\"]};function d(t){let e={a:\"a\",code:\"code\",h1:\"h1\",h2:\"h2\",h3:\"h3\",li:\"li\",p:\"p\",pre:\"pre\",strong:\"strong\",ul:\"ul\",...t.components},{DocsAppAction:r,DocsPreviewDocument:o,DocsPreviewSection:i}=e;return r||c(\"DocsAppAction\",!0),o||c(\"DocsPreviewDocument\",!0),i||c(\"DocsPreviewSection\",!0),(0,n.jsxs)(o,{anchors:\"lakehouse-credentials goal prerequisites steps 1-copy-the-credentials 2-choose-a-client-interface 3-configure-the-client verification troubleshooting next-steps\",children:[(0,n.jsxs)(i,{sectionId:\"lakehouse-credentials\",sectionTitle:\"Lakehouse credentials\",anchors:\"\",ancestors:\"\",index:\"0\",children:[(0,n.jsx)(e.h1,{id:\"lakehouse-credentials\",children:\"Lakehouse credentials\"}),`\n`,(0,n.jsx)(e.p,{children:\"Altertable automatically generates lakehouse username and lakehouse password credentials for each environment in your account.\"}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"goal\",sectionTitle:\"Goal\",anchors:\"\",ancestors:\"\",index:\"1\",children:[(0,n.jsx)(e.h2,{id:\"goal\",children:\"Goal\"}),`\n`,(0,n.jsx)(e.p,{children:\"Retrieve environment-specific lakehouse credentials and verify them against the HTTP query endpoint.\"}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"prerequisites\",sectionTitle:\"Prerequisites\",anchors:\"\",ancestors:\"\",index:\"2\",children:[(0,n.jsx)(e.h2,{id:\"prerequisites\",children:\"Prerequisites\"}),`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.a,{href:\"/docs/administration/access-control\",children:\"Access to the Altertable organization and environment\"}),\" you want to connect to.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Permission to view its \",(0,n.jsx)(e.strong,{children:\"Credentials\"}),\" section.\"]}),`\n`]}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"steps\",sectionTitle:\"Steps\",anchors:\"\",ancestors:\"\",index:\"3\",children:[(0,n.jsx)(e.h2,{id:\"steps\",children:\"Steps\"}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"1-copy-the-credentials\",sectionTitle:\"1. Copy the credentials\",anchors:\"\",ancestors:\"steps\",index:\"4\",children:[(0,n.jsx)(e.h3,{id:\"1-copy-the-credentials\",children:\"1. Copy the credentials\"}),`\n`,(0,n.jsxs)(e.p,{children:[\"Open \",(0,n.jsx)(e.strong,{children:\"Organization settings \\u2192 API keys & credentials\"}),\", then select the intended environment. Copy the lakehouse username and lakehouse password generated for the environment.\"]}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"2-choose-a-client-interface\",sectionTitle:\"2. Choose a client interface\",anchors:\"\",ancestors:\"steps\",index:\"5\",children:[(0,n.jsx)(e.h3,{id:\"2-choose-a-client-interface\",children:\"2. Choose a client interface\"}),`\n`,(0,n.jsx)(e.p,{children:\"These credentials work across all client interfaces for connecting to the lakehouse. Note that authentication methods may vary by interface\\u2014refer to the specific documentation for each client interface for details.\"}),`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.a,{href:\"/docs/api-references/lakehouse\",children:\"HTTP API\"}),\": send the credentials with HTTP Basic Auth.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.a,{href:\"/docs/lakehouse/clients/arrow-flight-sql\",children:\"Arrow Flight SQL\"}),\": pass the username and password to a compatible client over TLS.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.a,{href:\"/docs/lakehouse/clients/postgres\",children:\"Postgres adapter\"}),\": use the credentials in a TLS-enabled Postgres connection.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.a,{href:\"/docs/lakehouse/clients/cli\",children:\"Altertable CLI\"}),\": follow the setup guide to configure an authenticated local profile.\"]}),`\n`]}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"3-configure-the-client\",sectionTitle:\"3. Configure the client\",anchors:\"\",ancestors:\"steps\",index:\"6\",children:[(0,n.jsx)(e.h3,{id:\"3-configure-the-client\",children:\"3. Configure the client\"}),`\n`,(0,n.jsx)(e.p,{children:\"Follow the selected interface guide. Keep the username and password paired with the environment where Altertable generated them.\"}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"verification\",sectionTitle:\"Verification\",anchors:\"\",ancestors:\"\",index:\"7\",children:[(0,n.jsx)(e.h2,{id:\"verification\",children:\"Verification\"}),`\n`,(0,n.jsx)(e.p,{children:\"Set your lakehouse credentials, then run a query that needs no existing table:\"}),`\n`,(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:\"language-bash\",children:`export ALTERTABLE_USERNAME='{{LAKEHOUSE_USERNAME}}'\nexport ALTERTABLE_PASSWORD='{{LAKEHOUSE_PASSWORD}}'\n\ncurl https://api.altertable.ai/query \\\\\n  --user \"$ALTERTABLE_USERNAME:$ALTERTABLE_PASSWORD\" \\\\\n  -H 'Content-Type: application/json' \\\\\n  -d '{\"statement\":\"SELECT 1\"}'\n`})}),`\n`,(0,n.jsxs)(e.p,{children:[\"A valid connection returns a JSONL response for \",(0,n.jsx)(e.code,{children:\"SELECT 1\"}),\".\"]}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"troubleshooting\",sectionTitle:\"Troubleshooting\",anchors:\"\",ancestors:\"\",index:\"8\",children:[(0,n.jsx)(e.h2,{id:\"troubleshooting\",children:\"Troubleshooting\"}),`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Authentication fails:\"}),\" copy both credentials again and make sure neither value includes surrounding whitespace.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Credentials work in another environment:\"}),\" return to the intended environment before opening \",(0,n.jsx)(e.strong,{children:\"Credentials\"}),\".\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"A database client cannot connect:\"}),\" confirm that the hostname, port, and TLS settings match the selected interface guide.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"A CLI profile expired:\"}),\" \",(0,n.jsx)(e.a,{href:\"/docs/lakehouse/clients/cli#2-log-in\",children:\"log in again\"}),\" for that profile.\"]}),`\n`]}),`\n`,(0,n.jsx)(r,{destination:\"credentials\"}),`\n`]}),(0,n.jsxs)(i,{sectionId:\"next-steps\",sectionTitle:\"Next steps\",anchors:\"\",ancestors:\"\",index:\"9\",children:[(0,n.jsx)(e.h2,{id:\"next-steps\",children:\"Next steps\"}),`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsx)(e.li,{children:(0,n.jsx)(e.a,{href:\"/docs/lakehouse/query/http-api\",children:\"Query with HTTP API\"})}),`\n`,(0,n.jsx)(e.li,{children:(0,n.jsx)(e.a,{href:\"/docs/lakehouse/clients/arrow-flight-sql\",children:\"Connect with Arrow Flight SQL\"})}),`\n`,(0,n.jsx)(e.li,{children:(0,n.jsx)(e.a,{href:\"/docs/lakehouse/clients/postgres\",children:\"Connect with the Postgres adapter\"})}),`\n`,(0,n.jsx)(e.li,{children:(0,n.jsx)(e.a,{href:\"/docs/lakehouse/clients/cli\",children:\"Install the Altertable CLI\"})}),`\n`]})]})]})}function u(t={}){let{wrapper:e}=t.components||{};return e?(0,n.jsx)(e,{...t,children:(0,n.jsx)(d,{...t})}):d(t)}function c(t,e){throw new Error(\"Expected \"+(e?\"component\":\"object\")+\" `\"+t+\"` to be defined: you likely forgot to import, pass, or provide it.\")}return x(L);})();\n;return Component;"},"_id":"docs/administration/lakehouse-credentials.mdx","_raw":{"sourceFilePath":"docs/administration/lakehouse-credentials.mdx","sourceFileName":"lakehouse-credentials.mdx","sourceFileDir":"docs/administration","contentType":"mdx","flattenedPath":"docs/administration/lakehouse-credentials"},"type":"Docs","path":"/administration/lakehouse-credentials","level":2,"parent":"administration"}