Token Settings
Configure how JWT tokens are generated and managed:Available Options:
- JWT Expiration: Control how long access tokens remain valid (default: 7 days)
- Refresh Token Expiration: Set the lifespan of refresh tokens (default: 30 days)
- Signing Algorithm: Choose the algorithm for token signing (default: HS256)
- CORS Support: Enable/disable CORS for cross-origin requests
User Settings
Control token behavior based on WordPress user events. These settings are active and trigger automatically when the corresponding user action occurs.As of v0.2.3, all user lifecycle hooks are registered and functional. If you had these settings enabled on a previous version, they will now take effect after updating.
Revoke on Password Change
Automatically revoke all tokens when a user changes their password (default: true). Triggers on the WordPressprofile_update, password_reset, and after_password_reset hooks. This covers both admin-initiated password changes and user-initiated password resets.
Revoke on Email Change
Invalidate all tokens when a user updates their email address (default: true). Triggers on the WordPressprofile_update hook. Note that WordPress requires email change confirmation via a link sent to the new address — the revocation fires only after the user confirms the change and the profile is updated.
Revoke on Role Change
Revoke all tokens when a user’s role is modified (default: true). Triggers on the WordPressset_user_role hook. This ensures that any change in permissions immediately invalidates existing sessions.
Delete on User Delete
Remove all tokens and associated analytics records when a user is deleted (default: true). Triggers on the WordPressdelete_user hook. Unlike the other settings which revoke tokens (marking them inactive), this setting deletes tokens and their associated analytics data entirely to prevent orphaned database rows.
Data Management
Configure how JWT Auth Pro handles data:- Analytics Retention: Control how long authentication analytics are stored (options: 30, 90, 180, 360 days, or Forever)
- Delete on Deactivation: Choose whether to remove all plugin data upon deactivation (default: true)
- Anonymize IP: Option to anonymize IP addresses in analytics data (default: false)
Rate Limiting
Configure rate limiting for API endpoints:- Enable Rate Limiting: Turn rate limiting on/off (default: true)
- Max Requests: Maximum number of requests allowed in the time window (default: 60)
- Window Minutes: Time window for rate limiting in minutes (default: 1)
Advanced Configuration
Using RSA Keys (RS256)
By default, JWT Auth Pro uses HS256 (HMAC SHA-256) for token signing. You can switch to RS256 (RSA SHA-256) for enhanced security, especially in distributed systems.1. Generate RSA Keys
First, generate a private/public key pair:2. Configure Keys
Add these filters to your theme’sfunctions.php or a custom plugin:
3. Key Storage Example
A secure way to configure keys using constants:4. Using Key Strings Directly
Alternatively, you can use the RSA key strings directly in your code:Benefits of RS256
- Asymmetric Encryption: Different keys for signing and verification
- Better Security: Private key can be kept secret on the authentication server
- Scalability: Public key can be distributed to multiple verification servers
- Standard Compliance: Widely used in enterprise applications
All configuration options can be managed through the WordPress admin interface at Settings > JWT Auth Pro. The constants in
wp-config.php are optional and will override the settings in the admin interface if defined.