Anmeldung mit Microsoft Entra ID
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m37s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m40s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m42s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m10s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m6s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m55s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m2s
CI / Build-Artefakte aktuell (pull_request) Successful in 52s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m37s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m40s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m42s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m10s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m6s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m55s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m2s
CI / Build-Artefakte aktuell (pull_request) Successful in 52s
- OpenID Connect mit PKCE, State und Nonce; ID-Token-Prüfung gegen die Microsoft-Schlüssel (Signatur, Mandant, App, Gültigkeit, Nonce) inkl. Neuladen bei Schlüsselwechsel - Konto bei erster Anmeldung anlegen oder per E-Mail verknüpfen, optionale Domain-Beschränkung, deaktivierte Konten bleiben gesperrt - Gruppen (inkl. Overage über Graph, transitiv) und App-Rollen → Rollen, additiv; nur Zuweisungen aus Entra werden abgeglichen, manuelle bleiben - Profilfelder, Vorgesetzte*r und Profilfoto aus Graph, je Feld wählbar und im Portal schreibgeschützt; Fallback auf Token-Angaben, wenn Graph ausfällt - Hintergrund-Abgleich mit Delta-Abfragen (Zeitbudget, Fortsetzung über nextLink/deltaLink), Offboarding deaktivierter/gelöschter Konten, optionale Vorab-Anlage, Fotos/Vorgesetzte rollierend, Gruppen und App-Rollen stündlich - Admin „Anmeldung“: Einrichtung mit Umleitungs-URI und Berechtigungen, verschlüsseltes Geheimnis (nie im Browser), Gruppensuche, Status, „Mapping testen“ - Fix: @odata.nextLink/@odata.deltaLink wurden als Pfad gelesen – Folgeseiten fehlten - Profilseite mit Vorgesetzter/m und Mitarbeitenden; Version 0.4.0 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9ddc35a62c
commit
51c94cd0cf
111 changed files with 5721 additions and 244 deletions
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Resources\IdentityProviders\Pages;
|
||||
|
||||
use App\Filament\Resources\IdentityProviders\IdentityProviderResource;
|
||||
use App\Models\IdentityProvider;
|
||||
use App\Support\Audit;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateIdentityProvider extends CreateRecord
|
||||
{
|
||||
protected static string $resource = IdentityProviderResource::class;
|
||||
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
$data['type'] = IdentityProvider::ENTRA;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function afterCreate(): void
|
||||
{
|
||||
Audit::log('identity.provider_created', ['provider' => $this->record->name]);
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return IdentityProviderResource::getUrl('edit', ['record' => $this->record]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Resources\IdentityProviders\Pages;
|
||||
|
||||
use App\Filament\Resources\IdentityProviders\IdentityProviderResource;
|
||||
use App\Support\Audit;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
|
||||
class EditIdentityProvider extends EditRecord
|
||||
{
|
||||
protected static string $resource = IdentityProviderResource::class;
|
||||
|
||||
/**
|
||||
* Das Geheimnis nie ins Formular (und damit in den Browser) schreiben.
|
||||
*/
|
||||
protected function mutateFormDataBeforeFill(array $data): array
|
||||
{
|
||||
$data['config']['client_secret'] = null;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Leeres Geheimnis = gespeichertes behalten.
|
||||
*/
|
||||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
if (blank($data['config']['client_secret'] ?? null)) {
|
||||
$data['config']['client_secret'] = $this->record->setting('client_secret');
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function afterSave(): void
|
||||
{
|
||||
Audit::log('identity.provider_updated', ['provider' => $this->record->name, 'enabled' => $this->record->enabled]);
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('test')->label('Mapping testen')->icon(Heroicon::OutlinedBeaker)->color('gray')
|
||||
->url(fn () => IdentityProviderResource::getUrl('test', ['record' => $this->record])),
|
||||
DeleteAction::make()->modalDescription('Verknüpfungen und Rollen aus Entra-Gruppen werden entfernt. Die Konten selbst bleiben bestehen.'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Resources\IdentityProviders\Pages;
|
||||
|
||||
use App\Filament\Resources\IdentityProviders\IdentityProviderResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListIdentityProviders extends ListRecords
|
||||
{
|
||||
protected static string $resource = IdentityProviderResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [CreateAction::make()->label('Microsoft Entra ID anbinden')];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Resources\IdentityProviders\Pages;
|
||||
|
||||
use App\Filament\Resources\IdentityProviders\IdentityProviderResource;
|
||||
use App\Identity\Entra\MappingTester;
|
||||
use Filament\Resources\Pages\Concerns\InteractsWithRecord;
|
||||
use Filament\Resources\Pages\Page;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* „Mapping testen“: zeigt für eine Person, welche Gruppen und App-Rollen Entra
|
||||
* liefert und welche Rollen im Portal daraus entstehen.
|
||||
*/
|
||||
class TestMapping extends Page
|
||||
{
|
||||
use InteractsWithRecord;
|
||||
|
||||
protected static string $resource = IdentityProviderResource::class;
|
||||
|
||||
protected string $view = 'filament.pages.identity-test-mapping';
|
||||
|
||||
protected static ?string $title = 'Mapping testen';
|
||||
|
||||
public string $person = '';
|
||||
|
||||
/** @var array<string, mixed>|null */
|
||||
public ?array $result = null;
|
||||
|
||||
public ?string $error = null;
|
||||
|
||||
public function mount(int|string $record): void
|
||||
{
|
||||
$this->record = $this->resolveRecord($record);
|
||||
}
|
||||
|
||||
public function test(MappingTester $tester): void
|
||||
{
|
||||
$this->validate(['person' => ['required', 'string', 'max:255']], attributes: ['person' => 'E-Mail-Adresse']);
|
||||
$this->result = null;
|
||||
$this->error = null;
|
||||
|
||||
try {
|
||||
$this->result = $tester->test($this->record, trim($this->person));
|
||||
} catch (Throwable $e) {
|
||||
$this->error = $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue