- Install knpuniversity/oauth2-client-bundle and stevenmaguire/oauth2-keycloak - Register KnpUOAuth2ClientBundle in bundles.php - Configure Keycloak OIDC client (realm e-cosplay, auth.esy-web.dev) - Add keycloakId field to User entity with migration - Create KeycloakAuthenticator with group-to-role mapping (/superadmin -> ROLE_ROOT) - Create OAuthController with SSO routes (/connection/sso/login, logout, check) - Add custom_authenticator to security firewall with form_login entry point - Add auth.esy-web.dev to nelmio external_redirects whitelist and CSP form-action - Add SSO button and error flash messages to login page - Make navbar active state dynamic based on current route (desktop + mobile) - Add Keycloak env vars to .env, .env.local, and ansible/env.local.j2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
500 B
YAML
13 lines
500 B
YAML
knpu_oauth2_client:
|
|
clients:
|
|
keycloak:
|
|
type: generic
|
|
provider_class: Stevenmaguire\OAuth2\Client\Provider\Keycloak
|
|
client_id: '%env(OAUTH_KEYCLOAK_CLIENT_ID)%'
|
|
client_secret: '%env(OAUTH_KEYCLOAK_CLIENT_SECRET)%'
|
|
redirect_route: app_oauth_keycloak_check
|
|
redirect_params: {}
|
|
provider_options:
|
|
authServerUrl: '%env(OAUTH_KEYCLOAK_URL)%'
|
|
realm: '%env(OAUTH_KEYCLOAK_REALM)%'
|