OidcClientInterface), reducing boilerplate for common IdPs (Auth0, Keycloak, etc.).security.yaml, UserProvider, and Firewall components. Minimal custom code needed for basic OIDC flows.sub, email) via user_identifier_property, accommodating diverse backend schemas (e.g., databases, LDAP).docs/ms-entra-id.md).allow_discovery_access_token_issuer: true for on-prem deployments.userinfo responses).symfony/cache if not already present.token_leeway_seconds: 300 may cause issues with strict clock-skew environments (e.g., Kubernetes with misconfigured NTP)..env and drenso_oidc.yaml files.OidcUserProviderInterface?sub, email, etc.) should be used for authentication?REMEMBERME cookie acceptable?symfony/cache already in use?token_leeway_seconds be adjusted?OidcUserProviderInterface.enable_authenticator_manager: true in security.yaml.composer require drenso/symfony-oidc-bundle
well_known_url (e.g., https://your-idp.com/.well-known/openid-configuration)client_id and client_secret.config/packages/drenso_oidc.yaml with IdP credentials.security.yaml:
firewalls:
main:
oidc:
client: default
user_identifier_property: email # Optional: override 'sub'
OidcUserProviderInterface in your user provider:
class CustomUserProvider implements OidcUserProviderInterface {
public function ensureUserExists(string $userIdentifier, OidcUserData $userData, OidcTokens $tokens): UserInterface {
// Create/update user in your backend.
}
public function loadOidcUser(string $userIdentifier): UserInterface {
// Load user by identifier (e.g., from DB).
}
}
security.yaml:
providers:
oidc_provider:
id: App\Security\CustomUserProvider
/login_oidc):
#[Route('/login_oidc', name: 'login_oidc')]
public function login(OidcClientInterface $oidcClient): RedirectResponse {
return $oidcClient->generateAuthorizationRedirect();
}
symfony/security-bundle, symfony/http-client, and symfony/cache (for caching).PropertyAccess for dynamic user identifier resolution.well_known_parser).userinfo endpoint calls.allow_discovery_access_token_issuer.OidcUserProviderInterface.enable_remember_me and REMEMBERME cookie).enable_end_session_listener).token_leeway_seconds based on observed clock skew.How can I help you explore Laravel packages today?