Class JwtScenarios

java.lang.Object
org.pac4j.testkit.JwtScenarios

public final class JwtScenarios extends Object
Pre-assembled HTTP test scenarios for JWT (Bearer token) authentication.
  • Method Details

    • runHappyPath

      public static void runHappyPath(String serverUrl) throws IOException
      GET /protected with valid JWT -> 200
      Throws:
      IOException
    • runMissingToken

      public static void runMissingToken(String serverUrl) throws IOException
      GET /protected with no token -> 401
      Throws:
      IOException
    • runInvalidToken

      public static void runInvalidToken(String serverUrl) throws IOException
      GET /protected with garbage token -> 401
      Throws:
      IOException
    • runExpiredToken

      public static void runExpiredToken(String serverUrl) throws IOException
      GET /protected with expired JWT -> 401
      Throws:
      IOException
    • runAdminAccess

      public static void runAdminAccess(String serverUrl) throws IOException
      GET /protected/admin with admin JWT -> 200
      Throws:
      IOException
    • runAdminDenied

      public static void runAdminDenied(String serverUrl) throws IOException
      GET /protected/admin with user (non-admin) JWT -> 403
      Throws:
      IOException