-
-
Notifications
You must be signed in to change notification settings - Fork 158
✨ Forward LDAP based SSO identity via an HTTP header #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for header-based Single Sign-On (SSO) to the LDAP strategy, allowing trusted upstream gateways to authenticate users via headers like REMOTE_USER. When enabled, the strategy performs a directory lookup without requiring password authentication.
Key changes:
- Added
header_authandheader_nameconfiguration options with security-focused documentation - Modified request and callback phases to support header-based authentication flow
- Enhanced the
filtermethod to accept optional username override for directory lookups
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/omniauth/strategies/ldap.rb | Added header SSO logic in request/callback phases, new header_username and directory_lookup helper methods, and optional username_override parameter to filter method |
| spec/omniauth/strategies/ldap_spec.rb | Comprehensive test suite for header SSO covering redirects, authentication, name_proc application, and failure scenarios |
| sig/omniauth/strategies/ldap.rbs | Updated type signatures for new methods and modified filter signature to accept optional username parameter |
| README.md | Added detailed documentation for header SSO configuration with security warnings and examples; fixed RFC reference formatting |
| CHANGELOG.md | Added entry documenting the new header-based SSO feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @ldap_user_info = entry | ||
| @user_info = self.class.map_user(CONFIG, @ldap_user_info) | ||
| return super | ||
| rescue => e |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bare rescue catches all exceptions including syntax errors and system exits. Change to rescue StandardError => e to avoid catching non-application exceptions.
- e.g., REMOTE_USER
b637223 to
15b911c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #102 +/- ##
==========================================
- Coverage 97.71% 97.54% -0.18%
==========================================
Files 4 4
Lines 219 244 +25
Branches 59 67 +8
==========================================
+ Hits 214 238 +24
- Misses 5 6 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes and implements #87