Package org.pac4j.testkit
Class TestTokens
java.lang.Object
org.pac4j.testkit.TestTokens
Creates valid, expired, and invalid JWT tokens using a hardcoded RSA key pair.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringJWT that is structurally valid but already expired (exp = 1 hour ago).static StringGarbage string that fails JWT parsing.static KeyPairkeyPair()The RSA key pair used by both TestTokens and TestConfigs.jwtConfig().static StringJWT for user "admin" with ROLE_ADMIN, valid for 1 hour.static StringJWT for user "testuser" with ROLE_USER, valid for 1 hour.
-
Method Details
-
keyPair
The RSA key pair used by both TestTokens and TestConfigs.jwtConfig(). -
validUserToken
JWT for user "testuser" with ROLE_USER, valid for 1 hour. -
validAdminToken
JWT for user "admin" with ROLE_ADMIN, valid for 1 hour. -
expiredToken
JWT that is structurally valid but already expired (exp = 1 hour ago). -
invalidToken
Garbage string that fails JWT parsing.
-