Skip to content

Org-owned OAuth connection stores vault rows under the creating user's partition #1453

Description

@alanpog

Setup: self-hosted Cloudflare host, Cloudflare Access auth. An org-owned OAuth connection (owner: "org") whose OAuth consent flow completes in a human user's browser session.

Observed: the encrypted token rows are written to plugin_storage under that user's partition (owner='user', subject=<user uuid>, keys like oauth:user:<integration>:<connection>...), while the connection row itself says org. Every other principal (e.g. an Access service token) then fails the connection with oauth_connection_missing. The UI still shows the connection healthy, because the creating user's health probe can read the token rows.

Workaround that confirmed the diagnosis: a one-row D1 update moving the vault rows to owner='org', subject='' — encryption is global-key rather than principal-bound, so the rows decrypt fine afterwards and the connection works for all org principals.

Expected: token rows for an org-owned connection should be stored under the org partition regardless of which browser session completed the consent.

Happy to provide more detail from the reproduction if useful.

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