- Added knpuniversity/oauth2-client-bundle and league/oauth2-client to composer.json - Updated composer.lock with new dependencies - Registered KnpUOAuth2ClientBundle in bundles.php - Configured security.yaml for custom authenticator and access control - Created OIDC setup documentation (OIDC_SETUP.md) - Implemented OAuthController for handling Pocket-ID authentication flow - Developed PocketIdProvider and PocketIdResourceOwner for OIDC integration - Created PocketIdAuthenticator for user authentication and management - Updated login.html.twig to include Pocket-ID login button with styling - Added knpu_oauth2_client.yaml configuration for Pocket-ID client
234 lines
7.2 KiB
Twig
234 lines
7.2 KiB
Twig
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Login - myCRM</title>
|
|
{{ encore_entry_link_tags('app') }}
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.login-container {
|
|
background: white;
|
|
border-radius: 12px;
|
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
|
|
padding: 3rem;
|
|
width: 100%;
|
|
max-width: 450px;
|
|
}
|
|
.login-header {
|
|
text-align: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
.login-header h1 {
|
|
margin: 0;
|
|
color: #2563eb;
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
}
|
|
.login-header p {
|
|
margin: 0.5rem 0 0;
|
|
color: #6b7280;
|
|
font-size: 0.95rem;
|
|
}
|
|
.form-group {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 0.5rem;
|
|
color: #374151;
|
|
font-weight: 500;
|
|
font-size: 0.9rem;
|
|
}
|
|
.form-control {
|
|
width: 100%;
|
|
padding: 0.75rem 1rem;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 6px;
|
|
font-size: 1rem;
|
|
transition: border-color 0.2s, box-shadow 0.2s;
|
|
}
|
|
.form-control:focus {
|
|
outline: none;
|
|
border-color: #2563eb;
|
|
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
|
|
}
|
|
.btn-login {
|
|
width: 100%;
|
|
padding: 0.875rem;
|
|
background: #2563eb;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 6px;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
}
|
|
.btn-login:hover {
|
|
background: #1d4ed8;
|
|
}
|
|
.btn-login:active {
|
|
background: #1e40af;
|
|
}
|
|
.btn-oidc {
|
|
background: #10b981;
|
|
}
|
|
.btn-oidc:hover {
|
|
background: #059669;
|
|
}
|
|
.btn-oidc:active {
|
|
background: #047857;
|
|
}
|
|
.alert {
|
|
padding: 1rem;
|
|
border-radius: 6px;
|
|
margin-bottom: 1.5rem;
|
|
font-size: 0.9rem;
|
|
}
|
|
.alert-danger {
|
|
background: #fef2f2;
|
|
color: #991b1b;
|
|
border: 1px solid #fecaca;
|
|
}
|
|
.alert-info {
|
|
background: #eff6ff;
|
|
color: #1e40af;
|
|
border: 1px solid #bfdbfe;
|
|
}
|
|
.remember-me {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
.remember-me input[type="checkbox"] {
|
|
width: 18px;
|
|
height: 18px;
|
|
cursor: pointer;
|
|
}
|
|
.remember-me label {
|
|
margin: 0;
|
|
cursor: pointer;
|
|
font-weight: normal;
|
|
color: #6b7280;
|
|
}
|
|
.test-credentials {
|
|
margin-top: 2rem;
|
|
padding: 1rem;
|
|
background: #f9fafb;
|
|
border-radius: 6px;
|
|
font-size: 0.85rem;
|
|
}
|
|
.test-credentials h4 {
|
|
margin: 0 0 0.75rem;
|
|
color: #374151;
|
|
font-size: 0.9rem;
|
|
}
|
|
.test-credentials div {
|
|
margin: 0.5rem 0;
|
|
color: #6b7280;
|
|
}
|
|
.test-credentials code {
|
|
background: white;
|
|
padding: 0.25rem 0.5rem;
|
|
border-radius: 3px;
|
|
color: #2563eb;
|
|
font-family: 'Courier New', monospace;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="login-container">
|
|
<div class="login-header">
|
|
<h1>📊 myCRM</h1>
|
|
<p>Moderne CRM-Lösung</p>
|
|
</div>
|
|
|
|
{% if error %}
|
|
<div class="alert alert-danger">
|
|
{{ error.messageKey|trans(error.messageData, 'security') }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if app.user %}
|
|
<div class="alert alert-info">
|
|
Sie sind bereits angemeldet als <strong>{{ app.user.userIdentifier }}</strong>.
|
|
<a href="{{ path('app_logout') }}">Abmelden</a> oder
|
|
<a href="/">zum Dashboard</a>
|
|
</div>
|
|
{% else %}
|
|
<form method="post">
|
|
<div class="form-group">
|
|
<label for="username">E-Mail-Adresse</label>
|
|
<input
|
|
type="email"
|
|
value="{{ last_username }}"
|
|
name="_username"
|
|
id="username"
|
|
class="form-control"
|
|
autocomplete="email"
|
|
placeholder="ihre@email.de"
|
|
required
|
|
autofocus
|
|
>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="password">Passwort</label>
|
|
<input
|
|
type="password"
|
|
name="_password"
|
|
id="password"
|
|
class="form-control"
|
|
autocomplete="current-password"
|
|
placeholder="••••••••"
|
|
required
|
|
>
|
|
</div>
|
|
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
|
|
|
<div class="remember-me">
|
|
<input type="checkbox" name="_remember_me" id="_remember_me">
|
|
<label for="_remember_me">Angemeldet bleiben</label>
|
|
</div>
|
|
|
|
<button class="btn-login" type="submit">
|
|
Anmelden
|
|
</button>
|
|
</form>
|
|
|
|
<div style="text-align: center; margin: 1.5rem 0; color: #9ca3af; font-size: 0.9rem;">
|
|
oder
|
|
</div>
|
|
|
|
<a href="{{ path('connect_pocketid_start') }}" style="text-decoration: none;">
|
|
<button type="button" class="btn-login" style="background: #10b981; display: flex; align-items: center; justify-content: center; gap: 0.5rem;">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="12" cy="12" r="10"/>
|
|
<path d="M12 8v8M8 12h8"/>
|
|
</svg>
|
|
Mit Pocket-ID anmelden
|
|
</button>
|
|
</a>
|
|
|
|
<div class="test-credentials">
|
|
<h4>🔐 Test-Zugangsdaten (Development):</h4>
|
|
<div><strong>Administrator:</strong> <code>admin@mycrm.local</code> / <code>admin123</code></div>
|
|
<div><strong>Vertrieb:</strong> <code>sales@mycrm.local</code> / <code>sales123</code></div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|