- Introduced new components and services for OIDC app creation, enabling dynamic handling of app types, URIs, and user roles. - Added support for uploading and managing logos for connected apps. - Implemented `ClientCreationFactory` and related factories for modular OIDC client generation. - Updated UI to enhance app creation flow with post-creation credential display and improved validations. - Refactored backend with `OidcService` for streamlined OIDC app creation and management.
24 lines
684 B
PHP
24 lines
684 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\Applications\OIDC\Factory;
|
|
|
|
use App\Enums\ApplicationTypeEnum;
|
|
|
|
class ClientCreationFactory
|
|
{
|
|
public function __construct(
|
|
private readonly ClientCredentialsClientFactory $clientCredentialsClient,
|
|
private readonly AuthorizationCodeClientFactory $authorizationCodeClient,
|
|
) {}
|
|
|
|
public function for(ApplicationTypeEnum $applicationType): ClientCreationContract
|
|
{
|
|
return match ($applicationType) {
|
|
ApplicationTypeEnum::Web, ApplicationTypeEnum::SPA => $this->authorizationCodeClient,
|
|
ApplicationTypeEnum::Machine => $this->clientCredentialsClient,
|
|
};
|
|
}
|
|
}
|