Context
Neo4j Aura's public API (https://api.neo4j.io/oauth/token) only supports the OAuth2 client_credentials grant — there is no redirect authorization_code flow. Today the toolkit declares four auth schemes, two of which target this endpoint:
neo4j_oauth(mode: OAUTH2) — uses OAUTH2 mode but withtoken_params: { grant_type: 'client_credentials' }andauthorization_url === token_url, which is a hack around the missing client_credentials support in OAUTH2.neo4j_s2s_oauth2(mode: S2S_OAUTH2) — the correct mode, but currently a stub:strictFields: {}→ noclient_id/client_secretfields are exposed at auth-config creation, so users have no way to provide credentials.token_config.auth_methodis unset.token_config.params: {}→ no credentials are sent in the token exchange.
Net effect: the S2S scheme is visible in the UI but cannot actually succeed.
Proposed direction
Flesh out neo4j_s2s_oauth2 in mercury/apps/neo4j/config.ts to match the PayPal S2S pattern (see ComposioHQ/mercury#22415):
- Add
strictFields.db.client_idandstrictFields.db.client_secretwithfield_type: 'auth_config_field'. - Set
token_config.auth_method: 'basic'(Neo4j Aura accepts HTTP Basic). - Set
token_config.params: { client_id: fields.client_id, client_secret: fields.client_secret }.
Open questions for planning
- Do we deprecate or remove
neo4j_oauth? It overlaps with the S2S scheme and the redirect flow isn't real. - Any per-tenant/region URLs for Neo4j Aura that would require the same
base_url_hosteval-field trick used for PayPal / Zoho Mail?
References
- PayPal S2S fix (same pattern, recent):