-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Enhanced Digest Authentication, JWT & RFC Compliance #1470
Open
mdaneri
wants to merge
11
commits into
Badgerati:develop
Choose a base branch
from
mdaneri:RFC-7616-Compliance
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,860
−1,274
Conversation
This file contains 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
…ery Support - Added full support for RFC 7518 JWT algorithms: NONE, HS256, HS384, HS512, RS256, RS384, RS512, PS256, PS384, PS512, ES256, ES384, ES512. - Introduced `-PrivateKey` parameter in `New-PodeAuthScheme` for RSA and ECDSA JWT signature verification. - Ensured JWT signature validation follows RFC 7518 standards. - Improved JWT validation for `exp` (expiration) and `nbf` (not before) claims. - Added support for passing Bearer tokens via query parameters (`-BearerLocation Query`) as per RFC 6750. - Updated `WWW-Authenticate` handling to correctly return headers on authentication failures for all authentication methods. - Ensured Pode authentication mechanisms align with industry security standards. - Updated documentation to reflect these enhancements.
remove Invoke-PodeJWTSign merge Invoke-PodeJWTSign in New-PodeJwtSignature
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.
Overview
This pull request improves Pode’s authentication mechanisms by ensuring RFC compliance, fixing
WWW-Authenticate
headers on authentication failures, and improving request handling. Additionally, it enhances JWT authentication by supporting full RFC 7518 compliance and adds private key support for RSA and ECDSA algorithms. It also introduces support for bearer tokens in query parameters, following RFC 6750.Key Enhancements & Fixes
JWT Authentication Updates (RFC 7518 Compliance)
NONE
,HS256
,HS384
,HS512
(HMAC)RS256
,RS384
,RS512
(RSA)PS256
,PS384
,PS512
(RSA-PSS)ES256
,ES384
,ES512
(ECDSA)-PrivateKey
parameter inNew-PodeAuthScheme
for RSA and ECDSA verification.Bearer Token Support in Query Parameters (RFC 6750 Compliance)
Digest Authentication Updates (RFC 7616 Compliance)
MD5
,SHA-1
,SHA-256
,SHA-384
,SHA-512
, andSHA-512/256
.qop
) enhancements: Implementsauth-int
to include message integrity verification.WWW-Authenticate
header: Ensures theWWW-Authenticate
header is always returned on authentication failure, per RFC 7616.Fixes to
WWW-Authenticate
Header for All Authentication MethodsThis update ensures that the
WWW-Authenticate
header is correctly returned when authentication fails, adhering to RFC standards:WWW-Authenticate: Basic realm="ExampleRealm"
is included.WWW-Authenticate: Bearer error="invalid_token"
when authentication fails.WWW-Authenticate
consistency on failed login attempts.WWW-Authenticate
, even when authentication fails.New
$WebEvent.RawData
Field$WebEvent.RawData
, which captures the raw request body before parsing.auth-int
in Digest Authentication and custom authentication mechanisms.Windows-Specific Limitations
auth-int
is not supported natively.WWW-Authenticate
.examples/Utilities/DigestClient.ps1
for reference.Example Usage
Example: JWT Authentication with RSA
Example: Bearer Token in Query Parameter
Recommended Alternative:
Example: Digest Authentication with SHA-256 and
auth-int
Testing
auth
andauth-int
modes.WWW-Authenticate
is always present on authentication failure.$WebEvent.RawData
correctly captures raw request body content.References
PR Links: