Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 10.0.0-alpha.5 -- more fixes for SimpleSAMLphp 2 #249

Merged
merged 17 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added development/logo_idp1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added development/logo_idp2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added development/logo_idp3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ services:
- ./development/idp-local/config/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
- ./development/announcement.php:/data/vendor/simplesamlphp/simplesamlphp/announcement/announcement.php
- ./development/enable-exampleauth.sh:/data/enable-exampleauth.sh
- ./development/logo_idp1.png:/data/vendor/simplesamlphp/simplesamlphp/public/logo.png

# Utilize custom metadata
- ./development/idp-local/metadata/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
Expand Down Expand Up @@ -177,6 +178,7 @@ services:
MYSQL_PASSWORD: "silauth"
BASE_URL_PATH: "http://ssp-idp1.local/" # change this to "http://ssp-idp1.local:8085" for manual browser testing
HELP_CENTER_URL: "https://example.org/help"
THEME_COLOR_SCHEME: "blue_grey-teal"

ssp-idp2.local:
build: .
Expand All @@ -190,6 +192,7 @@ services:
# Utilize custom configs
- ./development/idp2-local/config/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
- ./development/enable-exampleauth.sh:/data/enable-exampleauth.sh
- ./development/logo_idp2.png:/data/vendor/simplesamlphp/simplesamlphp/public/logo.png

# Utilize custom metadata
- ./development/idp2-local/metadata/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
Expand Down Expand Up @@ -223,6 +226,7 @@ services:
MYSQL_PASSWORD: "silauth"
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
THEME_COLOR_SCHEME: "red-teal"

ssp-idp3.local:
build: .
Expand All @@ -232,6 +236,7 @@ services:

# Utilize custom configs
- ./development/idp3-local/config/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
- ./development/logo_idp3.png:/data/vendor/simplesamlphp/simplesamlphp/public/logo.png

# Utilize custom metadata
- ./development/idp3-local/metadata/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
Expand All @@ -254,6 +259,7 @@ services:
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
IDP_NAME: "IdP3"
THEME_COLOR_SCHEME: "orange-light_blue"

ssp-sp1.local:
image: silintl/ssp-base:9.3.0
Expand Down
11 changes: 5 additions & 6 deletions modules/expirychecker/public/about2expire.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@
$globalConfig = Configuration::getInstance();

$t = new Template($globalConfig, 'expirychecker:about2expire');
$t->data['formTarget'] = Module::getModuleURL('expirychecker/about2expire.php');
$t->data['formData'] = ['StateId' => $stateId];
$t->data['daysLeft'] = $state['daysLeft'];
$t->data['dayOrDays'] = (intval($state['daysLeft']) === 1 ? 'day' : 'days');
$t->data['expiresAtTimestamp'] = $state['expiresAtTimestamp'];
$t->data['accountName'] = $state['accountName'];
$t->data['theme_color_scheme'] = $globalConfig->getOptionalString('theme.color-scheme', null);
$t->data['analytics_tracking_id'] = $globalConfig->getOptionalString('analytics.trackingId', '');
$t->data['form_target'] = Module::getModuleURL('expirychecker/about2expire.php');
$t->data['form_data'] = ['StateId' => $stateId];
$t->data['days_left'] = $state['daysLeft'];
$t->send();

Logger::info('expirychecker - User has been warned that their password will expire soon.');
8 changes: 4 additions & 4 deletions modules/expirychecker/public/expired.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
$globalConfig = Configuration::getInstance();

$t = new Template($globalConfig, 'expirychecker:expired');
$t->data['formTarget'] = Module::getModuleURL('expirychecker/expired.php');
$t->data['formData'] = ['StateId' => $stateId];
$t->data['expiresAtTimestamp'] = $state['expiresAtTimestamp'];
$t->data['accountName'] = $state['accountName'];
$t->data['theme_color_scheme'] = $globalConfig->getOptionalString('theme.color-scheme', null);
$t->data['analytics_tracking_id'] = $globalConfig->getOptionalString('analytics.trackingId', '');
$t->data['form_target'] = Module::getModuleURL('expirychecker/expired.php');
$t->data['form_data'] = ['StateId' => $stateId];
$t->send();

Logger::info('expirychecker - User has been told that their password has expired.');
6 changes: 0 additions & 6 deletions modules/expirychecker/src/Auth/Process/ExpiryDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ public function redirect2PasswordChange(
): void {
$sessionType = 'expirychecker';
/* Save state and redirect. */
$state['expiresAtTimestamp'] = $expiryTimestamp;
$state['accountName'] = $accountName;
$id = State::saveState(
$state,
'expirychecker:redirected_to_password_change_url'
Expand Down Expand Up @@ -359,8 +357,6 @@ public function redirectToExpiredPage(array &$state, string $accountName, int $e
]));

/* Save state and redirect. */
$state['expiresAtTimestamp'] = $expiryTimestamp;
$state['accountName'] = $accountName;
$state['passwordChangeUrl'] = $this->passwordChangeUrl;
$state['originalUrlParam'] = $this->originalUrlParam;

Expand Down Expand Up @@ -396,8 +392,6 @@ protected function redirectToWarningPage(array &$state, string $accountName, int
}

/* Save state and redirect. */
$state['expiresAtTimestamp'] = $expiryTimestamp;
$state['accountName'] = $accountName;
$state['passwordChangeUrl'] = $this->passwordChangeUrl;
$state['originalUrlParam'] = $this->originalUrlParam;

Expand Down
9 changes: 4 additions & 5 deletions modules/material/themes/material/default/header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<base href="{{ baseurlpath }}/module.php/material/">

{% if analyticsTrackingId is defined and analyticsTrackingId is not empty %}
{% if analytics_tracking_id is defined and analytics_tracking_id is not empty %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ analyticsTrackingId }}"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ analytics_tracking_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];

Expand All @@ -17,12 +17,11 @@

gtag('js', new Date());

gtag('config', '{{ analyticsTrackingId }}');
gtag('config', '{{ analytics_tracking_id }}');
</script>
{% endif %}

{# FIXME: <link rel="stylesheet" href="material.{{ theme.color-scheme | e ?: 'indigo-purple' }}.1.2.1.min.css"> #}
<link rel="stylesheet" href="material.indigo-purple.1.2.1.min.css">
<link rel="stylesheet" href="material.{{ (theme_color_scheme ?? 'indigo-purple')|e }}.1.2.1.min.css">
<link rel="stylesheet" href="styles.2.3.6.css">

<script async src="material.1.2.1.min.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions modules/material/themes/material/default/other_mfas.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if otherOptions|length > 0 %}
{% if other_options|length > 0 %}
<div layout-children="column" child-spacing="center">
{# used type=button to avoid form submission on click since this is just used to display the ul #}
<button id="others" type="button" class="mdl-button mdl-js-button">
Expand All @@ -7,7 +7,7 @@
</span>
</button>
<ul class="mdl-menu mdl-js-menu mdl-menu--top-left" data-mdl-for="others">
{% for option in otherOptions %}
{% for option in other_options %}
{# TODO: Non-interactive elements should not be assigned mouse or keyboard event listeners. #}
<li class="mdl-menu__item" onclick="location.href = '{{ option.callback|raw }}'">
<span class="mdl-list__item-primary-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

<div class="mdl-layout-spacer"></div>

{% if helpCenterUrl is defined and helpCenterUrl is not empty %}
{% if help_center_url is defined and help_center_url is not empty %}
<nav class="mdl-navigation">
<a href="{{ helpCenterUrl|e(html_attr) }}" target="_blank" rel="noopener" class="mdl-navigation__link">
<a href="{{ help_center_url|e(html_attr) }}" target="_blank" rel="noopener" class="mdl-navigation__link">
{{ '{selectidp-links:help}'|trans }}
</a>
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
</header>
<main class="mdl-layout__content" layout-children="column">
<form layout-children="column">
{% for name, value in formData %}
{% for name, value in form_data %}
<input type="hidden" name="{{ name|e }}" value="{{ value|e }}">
{% endfor %}

<p class="mdl-typography--title margin">
{% if daysLeft < 2 %}
{% if days_left < 2 %}
{{ '{about2expire:expiring_in_a_day}'|trans }}
{% else %}
{{ '{about2expire:expiring_soon}'|trans({'%daysLeft%': daysLeft}) }}
{{ '{about2expire:expiring_soon}'|trans({'%daysLeft%': days_left}) }}
{% endif %}
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</header>
<main class="mdl-layout__content" layout-children="column">
<form layout-children="column">
{% for name, value in formData %}
{% for name, value in form_data %}
<input type="hidden" name="{{ name|e }}" value="{{ value|e }}">
{% endfor %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<div class="mdl-card__title center">
<p class="mdl-card__subtitle-text">
{{ '{mfa:running_out_info}'|trans({'%numBackupCodesRemaining%':numBackupCodesRemaining}) }}
{{ '{mfa:running_out_info}'|trans({'%numBackupCodesRemaining%': num_backup_codes_remaining}) }}
</p>
</div>

Expand Down
14 changes: 7 additions & 7 deletions modules/material/themes/material/mfa/new-backup-codes.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</header>
<main class="mdl-layout__content" layout-children="column">
<form layout-children="column" method="post">
{% if newBackupCodes is not empty %}
{% if new_backup_codes is not empty %}
<h1 class="mdl-typography--display-1">
{{ '{mfa:new_codes_header}'|trans }}
</h1>
Expand All @@ -57,12 +57,12 @@
<div class="mdl-card mdl-shadow--8dp" style="min-height: 17em">
<div class="mdl-card__supporting-text ff-temp-flexbug-fix" layout-children="column" id="code-card">
<p class="fill-parent" layout-children="row">
<span flex>{{ '{mfa:account}'|trans({'%idpName%':idpName}) }}</span>
<span flex>{{ '{mfa:account}'|trans({'%idpName%': idp_name}) }}</span>
<em class="mdl-typography--caption">{{ "now"|date("M j, Y") }}</em>
</p>

<div class="code-container">
{% for newCode in newBackupCodes %}
{% for newCode in new_backup_codes %}
<code>☐ {{ newCode }}</code>
{% endfor %}
</div>
Expand Down Expand Up @@ -90,8 +90,8 @@
</button>

<a
href="data:text/plain,{{ codesForDownload }}"
download="{{ idpName }}-printable-codes.txt"
href="data:text/plain,{{ codes_for_download }}"
download="{{ idp_name }}-printable-codes.txt"
class="mdl-button mdl-button--primary"
>
{{ '{mfa:button_download}'|trans }}
Expand All @@ -112,7 +112,7 @@
</script>
<button class="mdl-button mdl-button--primary" type="button" onclick="copyCodesToClipboard(this)">
{{ '{mfa:button_copy}'|trans }}
<textarea class="out-of-sight">{{ codesForClipboard }}</textarea>
<textarea class="out-of-sight">{{ codes_for_clipboard }}</textarea>
</button>
</div>
</div>
Expand All @@ -131,7 +131,7 @@
<div class="mdl-card__supporting-text">
<p>
{{ '{mfa:new_codes_failed}'|trans }}
<a href="{{ mfaSetupUrl }}" target="_blank" rel="noopener">{{ mfaSetupUrl }}</a>
<a href="{{ mfa_setup_url }}" target="_blank" rel="noopener">{{ mfa_setup_url }}</a>
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<div class="mdl-card__title center">
<p class="mdl-card__subtitle-text">
{% if hasOtherMfaOptions %}
{% if has_other_mfa_options %}
{{ '{mfa:has_options_besides_codes}'|trans }}
{% else %}
{{ '{mfa:has_no_more_options}'|trans }}
Expand All @@ -38,7 +38,7 @@
</div>

<div class="mdl-card__actions" layout-children="row">
{% if hasOtherMfaOptions %}
{% if has_other_mfa_options %}
<button name="continue" type="submit" class="mdl-button">
{{ '{mfa:button_later}'|trans }}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
</div>
</div>

{% if errorMessage is not empty %}
{% if error_message is not empty %}
<div class="mdl-card__supporting-text" layout-children="column">
<p class="mdl-color-text--red error">
<i class="material-icons">error</i>

<span class="mdl-typography--caption">
{{ errorMessage|e }}
{{ error_message|e }}
</span>
</p>
</div>

<script>
ga('send', 'event', 'error', 'backupcode', '{{ errorMessage|e('js')|raw }}');
ga('send', 'event', 'error', 'backupcode', '{{ error_message|e('js')|raw }}');
</script>
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<div class="mdl-card__title center">
<p class="mdl-card__subtitle-text">
{{ '{mfa:manager_sent}'|trans({'%managerEmail%': managerEmail}) }}
{{ '{mfa:manager_sent}'|trans({'%managerEmail%': manager_email}) }}
</p>
</div>

Expand All @@ -42,19 +42,19 @@
</div>
</div>

{% if errorMessage is not empty %}
{% if error_message is not empty %}
<div class="mdl-card__supporting-text" layout-children="column">
<p class="mdl-color-text--red error">
<i class="material-icons">error</i>

<span class="mdl-typography--caption">
{{ errorMessage|e }}
{{ error_message|e }}
</span>
</p>
</div>

<script>
ga('send', 'event', 'error', 'managercode', '{{ errorMessage|e('js')|raw }}');
ga('send', 'event', 'error', 'managercode', '{{ error_message|e('js')|raw }}');
</script>
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>

<div class="mdl-card__title center">
{{ '{mfa:account}'|trans({'%idpName%': idpName}) }}
{{ '{mfa:account}'|trans({'%idpName%': idp_name}) }}
</div>

<div class="mdl-card__supporting-text" layout-children="column">
Expand All @@ -40,19 +40,19 @@
</div>
</div>

{% if errorMessage is not empty %}
{% if error_message is not empty %}
<div class="mdl-card__supporting-text" layout-children="column">
<p class="mdl-color-text--red error">
<i class="material-icons">error</i>

<span class="mdl-typography--caption">
{{ errorMessage|e }}
{{ error_message|e }}
</span>
</p>
</div>

<script>
ga('send', 'event', 'error', 'totp', '{{ errorMessage|e('js')|raw }}');
ga('send', 'event', 'error', 'totp', '{{ error_message|e('js')|raw }}');
</script>
{% endif %}

Expand Down
Loading