Class ClientChainingScenarios

java.lang.Object
org.pac4j.testkit.ClientChainingScenarios

public final class ClientChainingScenarios extends Object
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 Details

    • runJwtSucceeds

      public static void runJwtSucceeds(String serverUrl) throws IOException
      GET /protected with valid JWT (first in chain) -> 200
      Throws:
      IOException
    • runApiKeySucceeds

      public static void runApiKeySucceeds(String serverUrl) throws IOException
      GET /protected with valid API key (second in chain) -> 200
      Throws:
      IOException
    • runNeitherFails

      public static void runNeitherFails(String serverUrl) throws IOException
      GET /protected with no auth headers -> 401
      Throws:
      IOException
    • runJwtPriorityOverApiKey

      public static void runJwtPriorityOverApiKey(String serverUrl) throws IOException
      Both valid JWT and API key -> 200 (JWT has priority)
      Throws:
      IOException
    • runJwtValidApiKeyInvalid

      public static void runJwtValidApiKeyInvalid(String serverUrl) throws IOException
      Valid JWT + invalid API key -> 200 (first client matches, second ignored)
      Throws:
      IOException
    • runJwtExpiredApiKeyValid

      public static void runJwtExpiredApiKeyValid(String serverUrl) throws IOException
      Expired JWT + valid API key -> 200 (first client fails, second succeeds)
      Throws:
      IOException