Skip to content

feat: Add richer reverse proxy authentication support#4737

Open
Jbansal2 wants to merge 1 commit into
TandoorRecipes:developfrom
Jbansal2:feature/richer-reverse-proxy-auth
Open

feat: Add richer reverse proxy authentication support#4737
Jbansal2 wants to merge 1 commit into
TandoorRecipes:developfrom
Jbansal2:feature/richer-reverse-proxy-auth

Conversation

@Jbansal2

@Jbansal2 Jbansal2 commented Jul 1, 2026

Copy link
Copy Markdown

Description

Implements richer reverse proxy authentication to address #1134

This PR adds support for extracting user information from additional reverse proxy headers and enables custom SSO logout URLs.

Changes

New Features

  • Support for HTTP_REMOTE_NAME header to auto-populate user's first/last name
  • Support for HTTP_REMOTE_EMAIL header to auto-populate user's email address
  • User information automatically updates on each login
  • New REVERSE_PROXY_AUTH_LOGOUT environment variable for custom SSO logout URLs

Technical Implementation

  • Created CustomRemoteUserBackend that extends Django's RemoteUserBackend
  • Added conditional URL override for logout when using reverse proxy auth
  • Maintains backward compatibility - existing setups continue to work

Documentation

  • Updated authentication documentation with examples
  • Added nginx configuration samples for Authelia/Authentik
  • Added configuration reference for new environment variable

Testing

  • Comprehensive test suite with 13 test cases
  • Tests cover name parsing, email updates, edge cases, and error handling

Usage Example

.env:

REMOTE_USER_AUTH=1
REVERSE_PROXY_AUTH_LOGOUT=https://authelia.example.com/logout

- Add HTTP_REMOTE_NAME and HTTP_REMOTE_EMAIL header support
- Implement CustomRemoteUserBackend to auto-update user info on login
- Add REVERSE_PROXY_AUTH_LOGOUT environment variable for custom SSO logout URLs
- Update documentation with examples for Authelia/Authentik integration
- Add comprehensive test suite for reverse proxy authentication
- Maintain backward compatibility with existing setups

Closes TandoorRecipes#1134
@CLAassistant

CLAassistant commented Jul 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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