- Introduced `needSignInUris` and `needSignOutUris` methods in `OidcConfigResolver` to determine URI requirements based on app type. - Updated `AuthorizationCodeClientFactory` to merge sign-in and sign-out URIs for redirect handling. - Enhanced app creation UI to conditionally display sign-in and sign-out URI fields. - Added authorization check for OIDC app creation using `AppPermissionEnum`.
37 lines
752 B
PHP
37 lines
752 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\Applications\OIDC;
|
|
|
|
use App\Enums\ApplicationTypeEnum;
|
|
|
|
class OidcConfigResolver
|
|
{
|
|
private ?ApplicationTypeEnum $applicationType = null;
|
|
|
|
public function for(ApplicationTypeEnum $applicationType): OidcConfigResolver
|
|
{
|
|
$this->applicationType = $applicationType;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function hasClientSecret(): bool
|
|
{
|
|
return ApplicationTypeEnum::SPA !== $this->applicationType;
|
|
}
|
|
|
|
public function needSignInUris(): bool
|
|
{
|
|
|
|
return ApplicationTypeEnum::Machine !== $this->applicationType;
|
|
}
|
|
|
|
public function needSignOutUris(): bool
|
|
{
|
|
|
|
return ApplicationTypeEnum::Machine !== $this->applicationType;
|
|
}
|
|
}
|