Skip to content

feat(login): add per-account custom request headers - #17926

Open
laugmanuel wants to merge 1 commit into
nextcloud:masterfrom
laugmanuel:feat/5821-custom-request-headers
Open

laugmanuel wants to merge 1 commit into
nextcloud:masterfrom
laugmanuel:feat/5821-custom-request-headers

Conversation

@laugmanuel

Copy link
Copy Markdown

Allow additional request headers per account, for example the credentials of a pre-authentication proxy

This fixes #5821

  • Login: collapsible "Advanced options" below the QR button with a "Name: value" field. Headers are captured only for server checks the user started, registered provisionally for the typed origin and stored in the account only if the account ends up on that origin.
  • Accounts: headers are kept as account user data, registered at app start, reconciled after an account was removed and editable later via "Custom headers" in the account menu.
  • Web views: GET requests to a registered origin go through the library client, which follows redirects only within that origin and syncs cookies on every hop; main frame redirects navigate to their target. Other requests of the page's fetch and XMLHttpRequest calls get the headers from a per-origin page script; fetch rejects redirects for them.
  • Glide: images of registered origins are loaded through the library client.
  • The transport for web views and Glide verifies host names like the web view does, accepting a mismatch only for certificates the user accepted.

This PR requires nextcloud/android-library#2192 and a library bump.

🖼️ Screenshots

Screenshot_20261031_223558_Nextcloud Screenshot_20261031_223551_Nextcloud Screenshot_20261031_223644_Nextcloud

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using Claude Code with Claude Opus 5.5

Allow additional request headers per account, for example the
credentials of a pre-authentication proxy

- Login: collapsible "Advanced options" below the QR button with a
  "Name: value" field. Headers are captured only for server checks the
  user started, registered provisionally for the typed origin and stored
  in the account only if the account ends up on that origin.
- Accounts: headers are kept as account user data, registered at app
  start, reconciled after an account was removed and editable later via
  "Custom headers" in the account menu.
- Web views: GET requests to a registered origin go through the library
  client, which follows redirects only within that origin and syncs
  cookies on every hop; main frame redirects navigate to their target.
  Other requests of the page's fetch and XMLHttpRequest calls get the
  headers from a per-origin page script; fetch rejects redirects for
  them.
- Glide: images of registered origins are loaded through the library
  client.
- The transport for web views and Glide verifies host names like the web
  view does, accepting a mismatch only for certificates the user accepted.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Manuel Laug <laugmanuel@gmail.com>

This branch has not been deployed

No deployments
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.

Custom headers for all requests

1 participant