roleService = $roleService; $this->oidcService = $oidcService; $this->configResolver = $configResolver; } public function mount(): void { $this->applicationType = ApplicationTypeEnum::from($this->type); } public function render() { /** @phpstan-ignore-next-line */ return $this->view()->title($this->title()); } public function save(bool $goBack = true): void { $this->authorize(AppPermissionEnum::Create->value); $this->form->validate(); $this->attempt( function () { $data = StoreOIDCAppData::fromArray($this->applicationType, $this->form->pull()); $appdata = $this->oidcService->createApp($data); $this->showCredentials($appdata); } ); } public function goBack(): void { $this->redirectRoute("apps.index", navigate: true); } public function title(): string { $title = "New "; $title .= match ($this->applicationType) { ApplicationTypeEnum::Web => "Web Application ", ApplicationTypeEnum::SPA => "Single Page Application ", // ApplicationTypeEnum::Machine => "Microservice Application ", }; $title .= "Integration"; return $title; } public function searchRoles(string $q = ''): void { $this->searchChoice('roles', $q); } public function selectAllRoles(): void { $this->selectAllChoice('roles'); } public function clearRoles(): void { $this->clearChoice('roles'); } #[Computed] public function hasClientSecret(): bool { return $this->configResolver->for($this->applicationType)->hasClientSecret(); } #[Computed] public function needSignInUris(): bool { return $this->configResolver->for($this->applicationType)->needSignInUris(); } #[Computed] public function needSignOutUris(): bool { return $this->configResolver->for($this->applicationType)->needSignOutUris(); } protected function choiceFields(): array { return [ 'roles' => new ChoiceField( search: fn(string $q): array => $this->roleService->searchRolesForSelect($q)->toArray(), allIds: $this->roleService->getAllRoleIds(...), formPath: 'form.roleIds', ), ]; } private function showCredentials(CreatedApplicationData $appData): void { $this->clientId = $appData->clientCredentials->clientId; $this->clientSecret = $appData->clientCredentials->clientSecret; $this->app = $appData->application; $this->created = true; } }; ?>
Allowed URIs which this app can ask to get the response back.
You can add this later.
Allowed URIs which this app can redirect the user back to after logout.
You can add this later.
Choose whether to allow all users be able to connect this app or selected ones.