Repository navigation
JWT Filter Chain Validation
Decoder tests show how a decoder handles claims. They do not prove that the configured HTTP security chain rejects a token before protected application code runs.
Use synthetic signed bearer tokens with test keys and send requests through the configured bearer-token filter chain. For each case, assert both the HTTP result and whether the protected controller or downstream operation ran.
Cover valid tokens and controlled invalid cases for issuer, expiration, signature, required client identifier, and other claims required by the issuer contract. Add missing-claim cases where policy requires the claim. Assert a successful control alongside each denial case.
Do not use a mock security context as evidence of bearer-token validation. Keep decoder tests as a complementary layer, not a substitute for HTTP-boundary tests.
In the reviewed Waste Plus configuration, validators check issuer, signature, time claims, and client_id. The legacy filter-chain test explicitly shows that a wrong audience reaches the protected controller. The backend filter-chain test does not assert wrong-audience rejection. The evidence therefore does not support a claim that both services enforce audience.
Some access-token contracts use client_id rather than aud. Confirm the actual issuer's token semantics and the application's policy before adding audience validation or treating a missing audience as a defect.
Synthetic-key tests establish local behavior for the configured test properties. They do not prove production issuer values, deployed JWKS reachability, key rotation, or the handling of real identity-provider tokens. Verify those deployment properties separately without using production credentials in test artifacts.
backend/src/main/java/ca/bc/gov/nrs/hrs/security/Oauth2SecurityCustomizer.javalegacy/src/main/java/ca/bc/gov/nrs/hrs/security/Oauth2SecurityCustomizer.javabackend/src/test/java/ca/bc/gov/nrs/hrs/security/JwtBearerFilterChainSecurityTest.javalegacy/src/test/java/ca/bc/gov/nrs/hrs/security/JwtBearerFilterChainSecurityTest.javabackend/src/test/java/ca/bc/gov/nrs/hrs/security/JwtValidationSecurityTest.javalegacy/src/test/java/ca/bc/gov/nrs/hrs/security/JwtValidationSecurityTest.javafinal/security-coverage-test-plan-2026-10-05.md
This wiki documents NR Waste Plus for users and developers. Verify security and deployment guidance against the current application configuration before applying it elsewhere.
- Report an issue or ask a question in the GitHub repository.
- Follow the Contributing Guidelines to propose an update.
- Read the Code of Conduct.
Collection indexes support human browsing and machine retrieval. Keep both current when adding or moving wiki pages.
NR Waste Plus Wiki | GitHub Repository