feat: Enterprise SSO Support with POST Authentication and Session Security#396
Merged
billchurch merged 1 commit intonewmainfrom Sep 9, 2025
Merged
feat: Enterprise SSO Support with POST Authentication and Session Security#396billchurch merged 1 commit intonewmainfrom
billchurch merged 1 commit intonewmainfrom
Conversation
…-based security Implements secure Single Sign-On (SSO) authentication via HTTP POST requests, enabling integration with enterprise SSO solutions like F5 BIG-IP APM and other identity providers. Key Features: - POST /ssh/host/:host endpoint for form-based authentication - Session-only authentication with server-side credential storage - Support for custom header-based authentication (X-APM-Username, X-APM-Password) - CSRF protection with configurable trusted proxies - Zero credential exposure in client-side HTML/JavaScript - Backward compatibility with existing GET routes and Basic Auth Security Enhancements: - Credentials stored in HTTPOnly Express sessions (never sent to client) - Optional CSRF token validation for POST requests - Trusted proxy IP whitelist support - Session data encrypted with configurable secret - No passwords, usernames, or keys exposed in browser Configuration: - Environment variable support for all SSO settings (WEBSSH2_SSO_*) - Configurable header mapping for different SSO providers - Support for both config.json and environment variables - Environment variables take precedence over config.json Implementation Details: - Added POST authentication middleware - Extended session management for credential storage - Integrated body-parser for form data processing - Added SSO configuration to envConfig.js - Comprehensive test suite for authentication flows - Documentation with BIG-IP APM integration examples
|
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.

Summary
Implements comprehensive enterprise Single Sign-On (SSO) authentication via secure HTTP POST requests, enabling seamless integration with identity providers like F5 BIG-IP APM, SAML providers, and other enterprise authentication systems.
Key Features
✅ POST Authentication Endpoint: New
POST /ssh/host/:hostroute for form-based authentication✅ Session-Only Security: Credentials stored server-side in HTTPOnly sessions, never exposed to client
✅ Enterprise SSO Integration: Support for custom authentication headers (X-APM-Username, X-APM-Password)
✅ CSRF Protection: Configurable CSRF token validation with trusted proxy support
✅ Zero Client Exposure: No passwords, usernames, or keys sent to browser JavaScript
✅ Backward Compatibility: Existing GET routes and Basic Auth continue to work unchanged
Security Enhancements
🔒 Session-Based Credentials: All authentication data stored in encrypted server sessions
🔒 CSRF Token Validation: Optional protection against cross-site request forgery
🔒 Trusted Proxy Whitelist: IP-based access control for enterprise environments
🔒 HTTPOnly Sessions: Credentials inaccessible to client-side JavaScript
🔒 Configurable Session Secrets: Encrypted session storage with custom keys
Configuration Support
⚙️ Dual Configuration: Support for both environment variables (
WEBSSH2_SSO_*) and config.json⚙️ Environment Priority: Environment variables override config.json values
⚙️ Flexible Header Mapping: Configurable authentication header names for different SSO providers
⚙️ Production Ready: Full environment variable support for containerized deployments
Changes Made
Core Authentication
/ssh/host/:hostendpoint with session-based authConfiguration & Environment
Testing & Documentation
Test Coverage
Files Changed
Deployment Notes
This change is fully backward compatible. Existing Basic Auth and GET routes continue to work unchanged. New SSO functionality requires configuration to enable:
Integration Examples