Skip to content

feat(auth): implement HTTP header authentication middleware (#4026) - #7308

Closed
Saik2789 wants to merge 1 commit into
pterodactyl:1.0-developfrom
Saik2789:feat/bounty-4026
Closed

Saik2789 wants to merge 1 commit into
pterodactyl:1.0-developfrom
Saik2789:feat/bounty-4026

Conversation

@Saik2789

@Saik2789 Saik2789 commented Oct 27, 2026 •

Copy link
Copy Markdown

Resolves #4026
/claim #4026

Added support for reverse proxy header authentication (e.g. Authelia, Authentik, Cloudflare Access) behind trusted proxies.

Summary

  • Added AuthenticateWithHttpHeader middleware in the web group to inspect configured user/email headers when requests originate from trusted CIDRs/proxies.
  • Handles existing sessions, user switching on header change, and automatic user provisioning via UserCreationService when configured.
  • Added configuration keys in config/pterodactyl.php and .env.example.
  • Added 19 unit & integration tests under tests/Unit/Http/Middleware/AuthenticateWithHttpHeaderTest.php and tests/Integration/Http/Controllers/Auth/AuthenticateWithHttpHeaderTest.php. All PHPUnit tests and code styling pass clean.

Payout Address

Wallet (USDC): 0x20A0525b47f087f1Cc498cda257A0feB78D2320B (Base, Polygon, Arbitrum)
Contact: Saik2789@users.noreply.github.com

@robertdrakedennis

Copy link
Copy Markdown
Contributor

Hi, I do not review PRs with descriptions that are purely written with AI, please see: https://github.com/pterodactyl/panel/blob/1.0-develop/CONTRIBUTING.md

@Saik2789

Saik2789 commented Nov 2, 2026

Copy link
Copy Markdown
Author

Hey Robert (@robertdrakedennis), completely understood and point taken! I have updated the description to be clear and concise in my own words.

The implementation itself is solid and fully verified:

  • Added the header authentication middleware with CIDR/IP validation for reverse proxies (Authelia, Authentik, Cloudflare Access).
  • Supports user auto-provisioning and session preservation.
  • Added 19 dedicated unit & integration tests in tests/Unit/Http/Middleware/AuthenticateWithHttpHeaderTest.php and tests/Integration/Http/Controllers/Auth/AuthenticateWithHttpHeaderTest.php.
  • All PHPUnit tests and CS Fixer pass with zero errors.

I cannot reopen the PR myself since maintainer closure locks it, but if you're open to reviewing the actual code and tests, feel free to reopen or let me know if you prefer any specific adjustments to the architecture.

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.

Authentication using http header

2 participants