Package org.pac4j.testkit
Class ClientChainingScenarios
java.lang.Object
org.pac4j.testkit.ClientChainingScenarios
Pre-assembled HTTP test scenarios for multiple authentication clients
chained on the same protected endpoint. Tests client priority order,
fallback, and mixed valid/invalid token handling.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidrunApiKeySucceeds(String serverUrl) GET /protected with valid API key (second in chain) -> 200static voidrunJwtExpiredApiKeyValid(String serverUrl) Expired JWT + valid API key -> 200 (first client fails, second succeeds)static voidrunJwtPriorityOverApiKey(String serverUrl) Both valid JWT and API key -> 200 (JWT has priority)static voidrunJwtSucceeds(String serverUrl) GET /protected with valid JWT (first in chain) -> 200static voidrunJwtValidApiKeyInvalid(String serverUrl) Valid JWT + invalid API key -> 200 (first client matches, second ignored)static voidrunNeitherFails(String serverUrl) GET /protected with no auth headers -> 401
-
Method Details
-
runJwtSucceeds
GET /protected with valid JWT (first in chain) -> 200- Throws:
IOException
-
runApiKeySucceeds
GET /protected with valid API key (second in chain) -> 200- Throws:
IOException
-
runNeitherFails
GET /protected with no auth headers -> 401- Throws:
IOException
-
runJwtPriorityOverApiKey
Both valid JWT and API key -> 200 (JWT has priority)- Throws:
IOException
-
runJwtValidApiKeyInvalid
Valid JWT + invalid API key -> 200 (first client matches, second ignored)- Throws:
IOException
-
runJwtExpiredApiKeyValid
Expired JWT + valid API key -> 200 (first client fails, second succeeds)- Throws:
IOException
-