Developer Guide
This section provides information for developers who want to extend or customize the SAML authentication functionality.
Architecture Overview
The extension uses the following key components:
AuthenticationService
The Authentication class extends TYPO3's authentication service
and handles:
- SAML response validation
- User lookup and creation
- Authentication status management
Location: Classes/
SamlService
The Saml class provides the interface to the onelogin/php-saml
library:
- SAML configuration management
- SSO redirect handling
- Response parsing
Location: Classes/
SettingsRepository
The Settings provides access to SAML configuration records:
- Auto-discovery by host
- Settings retrieval
Location: Classes/
Middleware
The Deep handles post-authentication redirects:
- Deep link support
- Logout redirect handling
It redirects to the Relay only if the value is a path on the
site (starting with a single /) or an absolute URL with the scheme,
host and port of the current request. Any other value is ignored and the
request is handled as usual.
Location: Classes/
Dependency Injection
All services are registered in the DI container and can be injected into your own classes:
use Netresearch\NrSamlAuth\Service\SamlService;
class MyController
{
public function __construct(
private readonly SamlService $samlService
) {}
}
Events
The extension dispatches no PSR-14 events of its own. The TYPO3 core events it listens to are listed in Events.