Skip to content

Provider sign-in: connect API keys and OAuth from the app #753

Open

Description

@ivanfenenko

Why

Adding a provider or re-authenticating an expired one currently needs the desktop. The web app does this in Settings > Providers (packages/app/src/settings/providers/providers.tsx), and the TUI has dialog-integration.tsx. Pasting an API key or finishing an OAuth login in the phone browser fits mobile well.

Current state

  • No provider auth, integration or credential calls on either platform.

Upstream API

  • v2: GET /api/integration, GET /api/integration/{id}
    • POST .../connect/key body { key, label? }
    • POST .../connect/oauth body { methodID } -> attempt; GET|DELETE .../connect/oauth/{attemptID}, POST .../complete
    • POST .../connect/external (70c6c8cbc5), .../connect/command/*
    • GET /api/credential, PATCH|DELETE /api/credential/{id}, POST /api/credential/{id}/activate (sign out / switch account; from OPE-272: Catch up with OpenCode API changes (3 breaking on 2.0.x + gaps) #546 leftovers)
  • v1: GET /provider/auth, POST /provider/{id}/oauth/authorize, POST /provider/{id}/oauth/callback, PUT /auth/{id}

App files

  • Android: new data/remote/IntegrationsApi.kt, provider/model settings UI
  • iOS: new Data/Remote/IntegrationsAPIClient.swift, provider/model settings UI

Acceptance criteria

  • Providers screen lists integrations with connected state
  • Connect with API key; connect with OAuth (open URL, poll attempt, or paste code)
  • Sign out / switch active credential
  • Models list refreshes after connect
  • v1 supported via /provider/auth; command-based methods can be shown as "use desktop"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions