---
id: TST-PFM-INT-532
title: oauth flow
kind: integration
product_area: platform
module: integrations
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-platform
files:
  - modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js
implements:
  - ATS-PFM-INT-005-08
  - ATS-PFM-INT-005-09
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Use the suite-owned database fixtures and its declared cleanup; prepare the test database before
  integration or lifecycle execution.
evidence:
  - >-
    services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js
test_cases:
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#answers
      the provider’s URL with the client, the one redirect, the state and the accepted capabilities’
      scopes
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#stores
      the state by its hash, bound to the connection and the user, for ten minutes
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#keeps
      the PKCE verifier as a tenant secret whose S256 is the challenge sent
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#is
      refused for a connection that authenticates with an entered credential
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#answers
      an OAuth connection’s authorization URL
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#refuses
      a key connection, asking for a new credential
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#exchanges
      the code with the verifier and the one redirect, and stores the tokens as the connection’s
      credential
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#moves
      the connection to verifying and names its credential
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#sends
      the browser to the console’s connection page with connected=1 and nothing else
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#writes
      no token and no code to the redirect or any log line
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#schedules
      the used verifier’s deletion
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#answers
      a page, not a redirect, for a state used once already
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#answers
      a page for an expired state
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#answers
      a page for a state whose signature does not verify
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#sends
      the browser back with error=access_denied when the person declined at the provider, storing nothing
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js#sends
      the browser back with error=exchange_failed when the token endpoint refuses the code
    provenance: test
dependency_evidence:
  provenance: test
  source: >-
    services-platform:modules/integrations/tests/integration/services/credentials/oauth-flow.integration.spec.js
  reviewed:
    - Suite introduction
    - Fixture setup
    - Client substitutions
    - Assertions and cleanup
---
# oauth flow

## Verification Boundary

This database and service suite exercises oauth flow. Its registration records the executable definition; no run result is asserted.

## What This Suite Proves

The bindings identify the detailed outcomes asserted by this suite. Test-level evidence retains the individual checks, including cases where several suites contribute to one scenario.

## What It Does Not Prove

In-process execution does not establish deployed infrastructure or a real provider response. Several bindings can supply different parts of a detailed scenario; no single-file completeness is implied.

## Real Dependencies and Test Doubles

The suite definition identifies its database fixtures and replaced clients, hooks, clocks or executors. Integration runs use the prepared database; lifecycle runs exercise the in-process route or adapter path.

## Must Not Be Doubled

The database constraints, transactions and service behavior claimed by an integration binding must execute. Replaced external seams cannot establish live provider or infrastructure behavior.
