{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"tdx auth - Authentication Management | Treasure Data","description":"Manage authentication for Treasure Data. Set up API key or OAuth login, check status, and clear credentials.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"auth-commands","__idx":0},"children":["Auth Commands"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Manage authentication for Treasure AI. Supports both browser-based OAuth and API key authentication."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"commands","__idx":1},"children":["Commands"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx auth                    # Show authentication status\ntdx auth status             # Alias for tdx auth\ntdx auth setup              # Setup authentication interactively\ntdx auth clear              # Remove credentials from system keychain\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"auth-status","__idx":2},"children":["Auth Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Display current authentication status and validate credentials:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx auth\ntdx auth --profile prod\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Shows the active profile, credential type (OAuth or API key), and validates by calling the TD API."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"auth-setup","__idx":3},"children":["Auth Setup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Interactive authentication setup. Choose between browser-based OAuth (recommended) or API key:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx auth setup\ntdx auth setup --site ap01\ntdx auth setup --profile prod\ntdx auth setup --account-name td7060   # SSO login for a specific account\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"browser-sign-in-oauth","__idx":4},"children":["Browser Sign-in (OAuth)"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select your Treasure AI site"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose \"Sign in with browser\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optionally enter an account name for SSO routing"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Browser opens for authentication"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After login, tokens are saved to system keychain"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["OAuth tokens are stored securely in the system keychain and used automatically for subsequent commands."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["OAuth opens a local callback server on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1:43594"]}," to receive the authorization response. The server times out after 2 minutes."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-key","__idx":5},"children":["API Key"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select your Treasure AI site"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose \"Use an API key\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter your API key (found at Console > API Keys)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Key is validated and saved to system keychain"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"auth-clear","__idx":6},"children":["Auth Clear"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Remove all credentials (API key and OAuth tokens) from the system keychain:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"tdx auth clear\ntdx auth clear --profile prod\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options","__idx":7},"children":["Options"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--site <site>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Target site (us01, ap01, eu01, ap02)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--profile <name>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Profile to use"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--account-name <name>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Account name for SSO login (auth setup only)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"environment-variables","__idx":8},"children":["Environment Variables"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDX_ACCESS_TOKEN"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Access token for Bearer authentication"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDX_ACCESS_TOKEN_<PROFILE>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Profile-specific access token"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDX_API_KEY"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API key for TD1 authentication"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDX_API_KEY_<PROFILE>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Profile-specific API key"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TD_OAUTH_CLIENT_ID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Override OAuth client ID (default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]},")"]}]}]}]}]}]},"headings":[{"value":"Auth Commands","id":"auth-commands","depth":1},{"value":"Commands","id":"commands","depth":2},{"value":"Auth Status","id":"auth-status","depth":2},{"value":"Auth Setup","id":"auth-setup","depth":2},{"value":"Browser Sign-in (OAuth)","id":"browser-sign-in-oauth","depth":3},{"value":"API Key","id":"api-key","depth":3},{"value":"Auth Clear","id":"auth-clear","depth":2},{"value":"Options","id":"options","depth":2},{"value":"Environment Variables","id":"environment-variables","depth":2}],"frontmatter":{"seo":{"title":"tdx auth - Authentication Management | Treasure Data","description":"Manage authentication for Treasure Data. Set up API key or OAuth login, check status, and clear credentials."}},"lastModified":"2026-05-18T01:25:54.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/treasure-code/commands/auth","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}