ldc-supportweb/app/Traits/Enums/SpsConfigTrait.php

53 lines
1 KiB
PHP
Raw Normal View History

2024-07-26 15:06:30 +02:00
<?php
namespace App\Traits\Enums;
trait SpsConfigTrait
{
/**
* acsBase64 method
* Return destination url base64 encoded
*
* @return string
*/
public function acsBase64(): string
{
return base64_encode($this->destination());
}
/**
* destination method
* Return acs url concatenated with url
*
* @return string
*/
public function destination(): string
{
return $this->url() . "/saml2/support/acs";
}
/**
* logout method
* Return sls url concatenated with url
*
* @return string
*/
public function logout(): string
{
return $this->url() . "/saml2/support/sls";
}
/**
* certificate method
* Return certificate (.pem) file from kebab case of Enum name
*
* @return string
*/
public function certificate(): string
{
return 'file://' . storage_path(
sprintf(
'samlidp/%s.pem',
str()->kebab($this->name)
)
);
}
}