Class TestConfigs

java.lang.Object
org.pac4j.testkit.TestConfigs

public final class TestConfigs extends Object
Provides standard pac4j Config objects for each authentication mechanism.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.pac4j.core.config.Config
    HTTP Basic authentication.
    static org.pac4j.core.config.Config
    Cookie-based session backed by JWT.
    static org.pac4j.core.config.Config
    API key via X-Api-Key header.
    static org.pac4j.core.config.Config
    Form-based authentication with username/password POST.
    static org.pac4j.core.config.Config
    JWT via Authorization: Bearer token header.
    static org.pac4j.core.config.Config
    oauthConfig(String mockOAuthServerUrl)
    OAuth2/OIDC authorization code flow via mock-oauth2-server.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • jwtConfig

      public static org.pac4j.core.config.Config jwtConfig()
      JWT via Authorization: Bearer token header.
    • formConfig

      public static org.pac4j.core.config.Config formConfig()
      Form-based authentication with username/password POST.
    • basicConfig

      public static org.pac4j.core.config.Config basicConfig()
      HTTP Basic authentication.
    • directConfig

      public static org.pac4j.core.config.Config directConfig()
      API key via X-Api-Key header.
    • cookieConfig

      public static org.pac4j.core.config.Config cookieConfig()
      Cookie-based session backed by JWT. Uses the same RSA key as jwtConfig().
    • oauthConfig

      public static org.pac4j.core.config.Config oauthConfig(String mockOAuthServerUrl)
      OAuth2/OIDC authorization code flow via mock-oauth2-server.
      Parameters:
      mockOAuthServerUrl - base URL of the running mock-oauth2-server (e.g. http://localhost:12345)