jweiland / jwauth
IP Address Authentication - Automatic frontend login based on the visitor's IP address
Requires
- typo3/cms-core: ^14.3
Requires (Dev)
- ergebnis/composer-normalize: ^2.44
- ssch/typo3-rector: ^3.6
- typo3/cms-install: ^14.3
- typo3/coding-standards: ^0.8
- typo3/testing-framework: ^9.5.0
This package is auto-updated.
Last update: 2026-08-13 14:10:53 UTC
README
TYPO3 extension providing a Frontend authentication service that logs in a
fe_users record automatically if the visitor's client IP address matches
one of the IP addresses configured on that record.
You will find the full documentation in the Documentation folder in reST
format, or rendered at docs.typo3.org.
1 Features
- Authenticate to the TYPO3 Frontend based on the visitor's static IP address (IPv4 and IPv6 are supported).
- A
fe_usersrecord can have any number of IP addresses/patterns — the visitor is logged in if any one of them matches (OR logic). - Also matches partial IP addresses (e.g. only the first octets/segments) or CIDR-masked IPv6 ranges, so a whole IP range can be granted access with a single entry.
- No password or login form required for these users.
2 How it works
- A new table
tx_jwauth_domain_model_ipaddressholds one IP address/pattern per record (seeConfiguration/TCA/tx_jwauth_domain_model_ipaddress.php, fieldip_address,max => 43to fit a full IPv6 address).fe_usersis linked to any number of these via aselect/selectMultipleSideBySidefieldip_addressesand an MM tabletx_jwauth_fe_users_ipaddress_mm(seeConfiguration/TCA/Overrides/fe_users.php). There is noext_tables.sql— TYPO3 derives both the new table's schema and the MM table's schema automatically from the TCA configuration. Classes/Service/IpAuthService.phpregisters itself as a TYPO3 authentication service of subtypegetUserFE,authUserFE(seeext_localconf.php). It runs withpriority = 70/quality = 70, which is higher thanfelogin/rsaauth(50/60) but lower than OpenID (75). If none of a visitor's IP addresses match anyfe_usersrecord, authentication simply falls through to the next configured service (e.g. felogin).IpAuthService::getUser()joinsfe_userswith the MM table and the new IP-address table in a single query, then checks each candidate address withGeneralUtility::cmpIP()— the one function that understands the*wildcard and/nnCIDR mask syntax the field supports, which plain SQL can't express.authUser()and the middleware below both delegate the same check to the sharedClasses/Service/IpAddressMatcher.php.ext_localconf.phpalso forces$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['FE_alwaysFetchUser'] = true;so the authentication chain — and therefore the IP check — runs on every request instead of relying on the PHP session.Classes/Middleware/ClearIpAuthenticatedSessionMiddleware.php(registered inConfiguration/RequestMiddlewares.php, running right after TYPO3's owntypo3/cms-frontend/authenticationmiddleware) logs the Frontend user off again — via the coreFrontendUserAuthentication::logoff()API — right after the response has been built, but only ifIpAddressMatcherconfirms one of the fe_user's IP addresses still matches the visitor's remote address. This replaces thehook_eofehook that older TYPO3 versions offered for this purpose and that has since been removed in favor of middlewares, the current API for running code around the whole Frontend request/response cycle. This is a deliberate security measure: an administrator must always be able to revoke this kind of access simply by deactivating the extension or removing the matching IP addresses — the visitor must not stay logged in via a lingering session.- Upgrading from a version before 5.0.0 (single
ip_addresscolumn)? Run the upgrade wizardjwauth_migrateIpAddressonce (Install Tool → Upgrade Wizards, orvendor/bin/typo3 upgrade:run jwauth_migrateIpAddress) to migrate existing values into the new relation.
3 Security notes
- Because the session is cleared after every request, IP-authenticated users
are effectively re-authenticated on every single page call. There is no
persistent login for them — deactivating
jwauthor removing the IP address immediately revokes access. - As a consequence there is no real "Logout" for these users: clicking logout just reloads the page, and the next request logs them in again via their IP address.
- Re-running the full authentication chain on every request can add a small amount of overhead per request.
4 Usage
4.1 Installation
Installation using Composer
The recommended way to install the extension is using Composer.
Run the following command within your Composer based TYPO3 project:
composer require jweiland/jwauth
vendor/bin/typo3 extension:setup --extension=jwauth
Installation as extension from TYPO3 Extension Repository (TER)
Download and install jwauth with the extension manager module.
4.2 Minimal setup
- Install and activate
jwauth - Add your static IP address to the
IP addressfield of the desiredfe_usersrecord (last tab of the record). Partial IPv4/IPv6 addresses are allowed; for IPv6 you must write out the full address (no::shorthand), padding missing segments with0, e.g.4324:0000:0000:0000:A5B3.
5 Requirements
- See
composer.json/ext_emconf.phpfor the exact TYPO3 version this release requires.
6 Support
Free Support is available via GitHub Issue Tracker.
For commercial support, please contact us at support@jweiland.net.