Repository navigation
Conversation
…pterodactyl#4026) Signed-off-by: Saik2789 <[EMAIL_REDACTED]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #4026
/claim #4026
Root Cause / Motivation
Reverse proxy authentication (e.g., Authelia, Authentik, Cloudflare Access, OAuth2-Proxy) passes authenticated user identity via HTTP request headers (such as
Remote-UserandRemote-Email). Previously, Pterodactyl Panel lacked support for header-based authentication, preventing SSO integration behind reverse proxies without manual credential entry.Key Changes
config/pterodactyl.php,.env.example): Addedpterodactyl.auth.headerconfiguration supportingAUTH_HEADER_ENABLED,AUTH_HEADER_USER,AUTH_HEADER_EMAIL,AUTH_HEADER_NAME,AUTH_HEADER_CREATE_USER, andAUTH_HEADER_TRUSTED_PROXIES.app/Http/Middleware/AuthenticateWithHttpHeader.php): Implemented header authentication middleware within thewebgroup:IpUtils::checkIp(or falls back to trusted proxies configuration).HTTP_/REMOTE_server variables).UserCreationServicewhencreate_useris enabled, sanitizing usernames to conform to panel validation rules.AuthManager::loginand dispatchesDirectLoginevent with session regeneration.app/Http/Kernel.php): RegisteredAuthenticateWithHttpHeaderin thewebmiddleware pipeline after session initialization.tests/Unit/Http/Middleware/AuthenticateWithHttpHeaderTest.php, 11 tests) and integration tests (tests/Integration/Http/Controllers/Auth/AuthenticateWithHttpHeaderTest.php, 8 tests) covering pass-through, proxy validation, existing user login, auto-creation, identity switching, and logout isolation.Verification & Test Proof
Executed PHP CS Fixer and PHPUnit suites (Unit and Integration):
Payout Address
Wallet (USDC on Base network): 0x20A0525b47f087f1Cc498cda257A0feB78D2320B
Contact: [EMAIL_REDACTED]