Skip to content

Support OAuth 2.0 client credentials for service accounts #445

Description

@musantro

Hi! First of all, thank you for the amazing work on this tool — really appreciate it.

Following up on #169 — bearer auth with service accounts works great for jtk, but I'm running into issues with cfl. Page reads fail with "scope does not match" because classic API tokens aren't accepted by the Confluence v2 API.

Atlassian service accounts can generate two types of credentials:

  1. Classic API tokens — work with v1 API only
  2. OAuth 2.0 credentials (client_id + client_secret) — work with v2 API

Since cfl uses the v2 API for page operations (/api/v2/pages/{id}), classic API tokens can't be used for reading pages, listing spaces, etc. Search works fine because it uses the v1 API (/rest/api/search).

$ cfl search "onboarding guide" --output plain
123456789	page	ENG	Onboarding Guide

$ cfl page view 123456789 --output plain
Error: getting page: getting page: unauthorized: check your credentials: Unauthorized; scope does not match

$ cfl space list
Error: listing spaces: listing spaces: unauthorized: check your credentials: Unauthorized; scope does not match

As far as I can tell, the only way to authenticate against the v2 API with a service account would be through OAuth 2.0 client credentials, which cfl doesn't support yet. But I might be missing something — is there a way to make this work with the current auth methods? Any guidance would be really appreciated!

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions