feat(server): add CredentialValidator trait for server-side auth#1172
Open
Greg Lamberson (glamberson) wants to merge 2 commits intoDevolutions:masterfrom
Open
feat(server): add CredentialValidator trait for server-side auth#1172Greg Lamberson (glamberson) wants to merge 2 commits intoDevolutions:masterfrom
Greg Lamberson (glamberson) wants to merge 2 commits intoDevolutions:masterfrom
Conversation
Add a CredentialValidator trait that allows servers to validate client credentials during connection setup. Called after the acceptor phase extracts credentials from ClientInfoPdu. This enables PAM, LDAP, and other validate-on-receipt auth flows for TLS-mode connections. Not used for CredSSP/Hybrid connections which handle authentication through NTLM challenge-response. - Add CredentialValidator trait with validate() method - Add set_credential_validator() to RdpServer - Validate credentials in client_accepted() before session start
There was a problem hiding this comment.
Pull request overview
Adds a server-side hook to validate client-supplied credentials (from ClientInfoPdu) during connection setup, enabling external authentication backends (PAM/LDAP/DB) in ironrdp-server.
Changes:
- Introduces a new public
CredentialValidatortrait. - Adds an optional validator to
RdpServerwith a setter API. - Invokes credential validation in
client_acceptedbefore entering the session loop.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Skip validation when credentials are None (reactivation, CredSSP) instead of bailing, consistent with Devolutions#1150/Devolutions#1155 design - Remove username from log messages to avoid leaking sensitive data - Keep validator error details in structured tracing field only - Add spawn_blocking guidance to trait doc for blocking backends
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.
Closes #1154
Summary
Add a CredentialValidator trait that lets servers validate client
credentials during connection setup, after the acceptor extracts them
from ClientInfoPdu (enabled by #1155).
This follows up on the API discussion in #1150: Option
is the wrong type to carry security policy. The trait makes auth an
explicit, application-supplied component rather than an implicit
builder default.
What it does
Design
For TLS-only connections, Client Info credentials are the only
credentials the application layer receives (no CredSSP). This trait
gives server implementations a clean hook to validate them against
PAM, LDAP, databases, or any external system.
Not used for CredSSP/Hybrid connections, where authentication happens
during the NTLM challenge-response exchange before ClientInfoPdu.
Example
Test plan