Skip to content

Add alternate payment credential headers - #821

Merged
brendanjryan merged 1 commit into
wevm:mainfrom
raubrey-stripe:raubrey/alternative-auth-header-challenge
Aug 25, 2026
Merged

Add alternate payment credential headers#821
brendanjryan merged 1 commit into
wevm:mainfrom
raubrey-stripe:raubrey/alternative-auth-header-challenge

Conversation

@raubrey-stripe

@raubrey-stripe raubrey-stripe commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

When using MPP in conjunction with traditional Auth schemes that use the Authorization header (like an API Key riding in Authorization: Bearer sk_...) there are conflicts - namely, Authorization header does not support multiple values.

I'm proposing a change to the MPP challenge that indicates in the WWW-Authenticate response header what request header the client should put the payment challenge into.

Proposed new header field in challenge

  HTTP/1.1 402 Payment Required
  WWW-Authenticate: Payment id="pay_abc123",
    realm="api.example.com",
    method="tempo",
    intent="charge",
    // This guy says you should not use the default Authorization header, but instead use Payement-Authorization
    header="Payment-Authorization", 
    request="eyJhbW91bnQiOiIxMDAwIn0"

If header is not included, the challenge should be included in the Authorization header.

@pkg-pr-new

pkg-pr-new Bot commented Aug 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/mppx@821

commit: 410a9c5

@brendanjryan
brendanjryan marked this pull request as ready for review August 21, 2026 00:36
Comment thread src/Challenge.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1c70e84b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Challenge.ts Outdated
Comment thread src/server/Mppx.ts Outdated
Comment thread src/Challenge.ts
Comment thread src/proxy/Proxy.ts
Comment thread src/proxy/Proxy.ts
Comment thread src/client/internal/protocols/Shared.ts
Comment thread src/server/Mppx.ts
@raubrey-stripe

Copy link
Copy Markdown
Contributor Author

@brendanjryan incorporated your feedback to get the the nil --> Authorization bits! I also have attempted to upstream this in the spec: tempoxyz/mpp-specs#328

@raubrey-stripe raubrey-stripe changed the title WIP: Add alternate payment credential headers Add alternate payment credential headers Aug 21, 2026
Comment thread plans/auth-header.md Outdated
Advertise an optional challenge header so Payment credentials can use Payment-Authorization while Authorization stays available for ordinary auth.

Includes the default-Authorization behavior and drops internal plan notes.
@raubrey-stripe
raubrey-stripe force-pushed the raubrey/alternative-auth-header-challenge branch from 212af53 to 410a9c5 Compare August 25, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants