Skip to content

Commit

Permalink
dynamic saml registration from env
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-staab committed Feb 24, 2024
1 parent d77900d commit 8fae77e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions config/samlidp.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php

foreach (['DEV'] as $community){
$domain = env('SAML_SP_DOMAIN_' . $community, '');
foreach (explode(',', env('SAML_COMMUNITIES')) as $community){
$domain = env('SAML_SP_DOMAIN_' . $community);
$secure = !str_contains($domain, 'localhost');
$protocol = "http" . ($secure? 's': '') . "://";
$port = $secure ? 443 : 80;
//$entityId = "https://" . $domain . "/auth/metadata";
$SPs_config[base64_encode("http://" . $domain . "/auth/login")] = [
'destination' => "http://" . $domain . "/auth/login",
$SPs_config[base64_encode("$protocol$domain:$port/auth/login")] = [
'destination' => $protocol . $domain . "/auth/login",
'logout' => "https://" . $domain . '/auth/logout',
'certificate' => env('SAML_SP_CERT_' . $community, ''),
'query_params' => false,
Expand Down

0 comments on commit 8fae77e

Please sign in to comment.