Skip to content

feat: add OAuth login profiles#87

Merged
Mukil Loganathan (langchain-infra) merged 7 commits into
mukil/profile-managementfrom
mukil/oauth-login-split
Apr 30, 2026
Merged

feat: add OAuth login profiles#87
Mukil Loganathan (langchain-infra) merged 7 commits into
mukil/profile-managementfrom
mukil/oauth-login-split

Conversation

@langchain-infra
Copy link
Copy Markdown
Contributor

Stacked on: mukil/profile-management

Summary:

  • add langsmith login with OAuth device-code flow
  • store OAuth access/refresh tokens under the selected profile
  • refresh profile OAuth tokens when they are missing or near expiry
  • use OAuth access tokens as Authorization bearer headers for CLI and raw API commands
  • bump github.com/langchain-ai/langsmith-go to v0.6.0 so SDK clients can read the same profile config

OAuth profile format:

{
  "current_profile": "local",
  "profiles": {
    "local": {
      "api_url": "http://localhost:1980",
      "workspace_id": "00000000-0000-0000-0000-000000000000",
      "oauth": {
        "access_token": "REDACTED_OAUTH_ACCESS_TOKEN",
        "refresh_token": "REDACTED_OAUTH_REFRESH_TOKEN",
        "expires_at": "2026-04-29T18:00:00Z"
      }
    }
  }
}

Example commands:

langsmith login --api-url http://127.0.0.1:1980 --profile local --workspace-id 593d649c-2548-4069-af4b-c8867e279ee6 --no-browser
{
  "oauth_expires_at": "2026-04-30T01:08:51Z",
  "profile": "local",
  "status": "logged_in",
  "workspace_id": "593d649c-2548-4069-af4b-c8867e279ee6"
}
langsmith --profile dev --format pretty profile list
  ACTIVE    NAME     API URL                              WORKSPACE ID                            AUTH     EXPIRES AT
---------+-------+-------------------------------------+--------------------------------------+-------+----------------------
  *         dev      https://dev.api.smith.langchain.com    d6684905-655c-429b-bd14-ba302d94c03b    oauth    2026-04-30T02:50:40Z
            local    http://127.0.0.1:1980                  593d649c-2548-4069-af4b-c8867e279ee6    oauth    2026-04-30T01:08:51Z
langsmith --profile dev api GET "/api/v1/sessions?limit=1" --include
HTTP/2.0 200 OK
X-Pagination-Total: 2
Content-Type: application/json

[
  {
    "name": "integ-test-zjgj-96959",
    "id": "8d565e27-6157-44ad-a694-9ab6fdc87e82",
    "tenant_id": "d6684905-655c-429b-bd14-ba302d94c03b"
  }
]

Verification:

  • go test ./... -count=1 on mukil/oauth-login-split
  • go test ./... -count=1 on base branch mukil/profile-management

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@langchain-infra Mukil Loganathan (langchain-infra) merged commit bc08e84 into mukil/profile-management Apr 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants