Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit cfb4fca

Browse files
author
Billy Clark
committed
Clients wanted to see more idps on hub
1 parent 9b54706 commit cfb4fca

File tree

9 files changed

+129
-66
lines changed

9 files changed

+129
-66
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ content of that announcement. HTML is supported.
5757
3. Click **hub-discovery**
5858

5959
### Error
60-
1. Click **Configuration** tab
60+
1. Click **Federation** tab
61+
2. Click either **Show metadata** link
6162

6263
### Logout
6364
1. Click **Authentication** tab

development/hub/saml20-idp-remote.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,42 @@
2121
'SingleLogoutService' => 'http://ssp-hub-idp2.local:8086/saml2/idp/SingleLogoutService.php',
2222
'certData' => 'MIIDzzCCAregAwIBAgIJALBaUrvz1X5DMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOQzEPMA0GA1UEBwwGV2F4aGF3MQwwCgYDVQQKDANTSUwxDTALBgNVBAsMBEdUSVMxDjAMBgNVBAMMBVN0ZXZlMSQwIgYJKoZIhvcNAQkBFhVzdGV2ZV9iYWd3ZWxsQHNpbC5vcmcwHhcNMTYxMDE4MTQwMDUxWhcNMjYxMDE4MTQwMDUxWjB+MQswCQYDVQQGEwJVUzELMAkGA1UECAwCTkMxDzANBgNVBAcMBldheGhhdzEMMAoGA1UECgwDU0lMMQ0wCwYDVQQLDARHVElTMQ4wDAYDVQQDDAVTdGV2ZTEkMCIGCSqGSIb3DQEJARYVc3RldmVfYmFnd2VsbEBzaWwub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx5mZNwjEnakJho+5etuFyx+2g9rs96iLX/LDC24aBAsdNxTNuIc1jJ7pxBxGrepEND4LkietLNBlOr1q50nq2+ddTrCfmoJB+9BqBOxcm9qWeqWbp8/arUjaxPzK3DfZrxJxIVFjzqFF7gI91y9yvEW/fqLRMhvnH1ns+N1ne59zr1y6h9mmHfBffGr1YXAfyEAuV1ich4AfTfjqhdwFwxhFLLCVnxA0bDbNw/0eGCSiA13N7a013xTurLeJu0AQaZYssMqvc/17UphH4gWDMEZAwy0EfRSBOsDOYCxeNxVajnWX1834VDpBDfpnZj996Gh8tzRQxQgT9/plHKhGiwIDAQABo1AwTjAdBgNVHQ4EFgQUApxlUQg26GrG3eH8lEG3SkqbH/swHwYDVR0jBBgwFoAUApxlUQg26GrG3eH8lEG3SkqbH/swDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEANhbm8WgIqBDlF7DIRVUbq04TEA9nOJG8wdjJYdoKrPX9f/E9slkFuD2StcK99RTcowa8Z2OmW7tksa+onyH611Lq21QXh4aHzQUAm2HbsmPQRZnkByeYoCJ/1tuEho+x+VGanaUICSBVWYiebAQVKHR6miFypRElibNBizm2nqp6Q9B87V8COzyDVngR1DlWDduxYaNOBgvht3Rk9Y2pVHqym42dIfN+pprcsB1PGBkY/BngIuS/aqTENbmoC737vcb06e8uzBsbCpHtqUBjPpL2psQZVJ2Y84JmHafC3B7nFQrjdZBbc9eMHfPo240Rh+pDLwxdxPqRAZdeLaUkCQ==',
2323
];
24+
$metadata['jaars-idp'] = [
25+
'enabled' => true,
26+
'metadata-set' => 'saml20-idp-remote',
27+
'entityid' => 'jaars-idp',
28+
'name' => [
29+
'en' => 'jaars'
30+
],
31+
'logoURL' => 'https://static.gtis.guru/idp-logo/jaars-logo.png'
32+
];
33+
$metadata['sil-idp'] = [
34+
'enabled' => true,
35+
'metadata-set' => 'saml20-idp-remote',
36+
'entityid' => 'sil-idp',
37+
'name' => [
38+
'en' => 'sil'
39+
],
40+
'logoURL' => 'https://static.gtis.guru/idp-logo/sil-logo.png'
41+
];
42+
$metadata['usa-idp'] = [
43+
'enabled' => true,
44+
'metadata-set' => 'saml20-idp-remote',
45+
'entityid' => 'usa-idp',
46+
'name' => [
47+
'en' => 'usa'
48+
],
49+
'logoURL' => 'https://static.gtis.guru/idp-logo/usa-logo.png'
50+
];
51+
$metadata['wga-idp'] = [
52+
'enabled' => true,
53+
'metadata-set' => 'saml20-idp-remote',
54+
'entityid' => 'wga-idp',
55+
'name' => [
56+
'en' => 'wga'
57+
],
58+
'logoURL' => 'https://static.gtis.guru/idp-logo/wga-logo.png'
59+
];
2460
$metadata['mock-jaars-idp'] = [
2561
'enabled' => false,
2662
'metadata-set' => 'saml20-idp-remote',

dictionaries/selectidp.definition.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"fr": "Choisissez un compte",
1313
"ko": "계정 선택"
1414
},
15-
"button_login": {
16-
"en": "Login with {idpName}",
17-
"es": "Inicia con {idpName}",
18-
"fr": "Connectez-vous avec {idpName}",
19-
"ko": "로 로그인 {idpName}"
15+
"future": {
16+
"en": "Planned for a future release.",
17+
"es": "Planeado para una versión futura.",
18+
"fr": "Prévu pour une version future.",
19+
"ko": "향후 릴리스 예정입니다."
2020
},
21-
"button_login_disabled": {
22-
"en": "Coming soon...",
23-
"es": "Próximamente...",
24-
"fr": "à venir bientôt...",
25-
"ko": "곧 출시 될 예정입니다."
21+
"logo": {
22+
"en": "{idpName} logo",
23+
"es": "Logotipo de {idpName}",
24+
"fr": "Logo {idpName}",
25+
"ko": "{idpName} 로고"
2626
}
2727
}

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ services:
1616
SHOW_SAML_ERRORS: "true"
1717
THEME_USE: "material:material"
1818
HUB_MODE: "true"
19+
ADMIN_EMAIL: "[email protected]"
20+
SECRET_SALT: "FcJwl0zCDc4nuzOuQL9/7WPIj3hdfusGm2ny0dcRQm0="
21+
IDP_NAME: "The Hub"
1922
idp1:
2023
image: silintl/ssp-base:develop
2124
volumes:
@@ -31,6 +34,8 @@ services:
3134
SHOW_SAML_ERRORS: "true"
3235
ADMIN_PROTECT_INDEX_PAGE: "false"
3336
THEME_USE: "default:default"
37+
ADMIN_EMAIL: "[email protected]"
38+
SECRET_SALT: "8yC5mb4wqANaU+Rxrl4DHkfKzikeieXkltfFd+YDzx8="
3439
IDP_NAME: "Idp 1"
3540
idp2:
3641
image: silintl/ssp-base:develop
@@ -48,4 +53,6 @@ services:
4853
SHOW_SAML_ERRORS: "true"
4954
ADMIN_PROTECT_INDEX_PAGE: "false"
5055
THEME_USE: "material:material"
56+
ADMIN_EMAIL: "[email protected]"
57+
SECRET_SALT: "edI4GGkYfkzD6/OXFvHBHb9Meu9hdKXQpNFg4q/GGfY="
5158
IDP_NAME: "Idp 2"

themes/material/core/loginuserpass.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$username = $this->data['username'] ?? null;
55
$forgotPasswordUrl = $this->data['forgotPasswordUrl'] ?? null;
66
$csrfToken = $this->data['csrfToken'] ?? null;
7-
$idpName = $this->data['idp_name'] ?? '';
7+
$idpName = $this->configuration->getValue('idp_name', '');
88

99
$errorCode = $this->data['errorcode'] ?? null;
1010
$errorMessageKey = $this->data['errorparams'][1] ?? '{material:login:error_wronguserpass}';
@@ -19,7 +19,8 @@
1919
<?php
2020
if (! empty($siteKey)) {
2121
?>
22-
<script src='https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit' async defer></script>
22+
<script src='https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit'
23+
async defer></script>
2324

2425
<script>
2526
function submitForm() {
@@ -38,16 +39,17 @@ function onRecaptchaLoad() {
3839
<?php
3940
}
4041
?>
41-
4242
</head>
4343
<body class="gradient-bg">
4444
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
45-
<?php include __DIR__ . '/../common-announcement.php' ?>
45+
<main class="mdl-layout__content" layout-children="column" child-spacing="center">
46+
<?php include __DIR__ . '/../common-announcement.php' ?>
4647

47-
<main class="mdl-layout__content">
48-
<div class="mdl-card mdl-shadow--8dp unfix-width">
48+
<div class="mdl-card mdl-shadow--8dp">
4949
<div class="mdl-card__media white-bg margin">
50-
<img src="/logo.png" alt="<?= $this->t('{material:login:logo}', ['{idpName}' => $idpName]) ?>">
50+
51+
<img src="https://static.gtis.guru/idp-logo/sil-logo.png"
52+
alt="<?= $this->t('{material:login:logo}', ['{idpName}' => $idpName]) ?>">
5153
</div>
5254

5355

@@ -84,13 +86,13 @@ function onRecaptchaLoad() {
8486
<?php
8587
if ($errorCode == 'WRONGUSERPASS') {
8688
?>
87-
<p class="mdl-color-text--red" layout-children="row" child-spacing="space-between">
88-
<i class="material-icons">error</i>
89+
<p class="mdl-card__supporting-text mdl-color-text--red error">
90+
<i class="material-icons margin">error</i>
8991

90-
<span class="mdl-textfield mdl-typography--caption margin">
91-
<?= $this->t($errorMessageKey, $errorMessageTokens) ?>
92-
</span>
93-
</p>
92+
<span class="mdl-textfield mdl-typography--caption">
93+
<?= $this->t($errorMessageKey, $errorMessageTokens) ?>
94+
</span>
95+
</p>
9496
<?php
9597
}
9698
?>
@@ -116,7 +118,6 @@ class="mdl-typography--caption margin">
116118
</div>
117119
</div>
118120
</main>
119-
120121
</div>
121122
</body>
122123
</html>

themes/material/default/error.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
</div>
1616
</header>
1717

18-
<main class="mdl-layout__content" layout-children="column">
19-
<p><?= $this->t('{material:error:message}') ?><p>
18+
<main class="mdl-layout__content margin" layout-children="column">
19+
<p>
20+
<?= $this->t('{material:error:message}') ?>
21+
</p>
2022

2123
<?php
2224
if ($this->data['showerrors']) {

themes/material/default/logout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616
</header>
1717

18-
<main class="mdl-layout__content">
18+
<main class="mdl-layout__content margin" layout-children="column">
1919
<p><?= $this->t('{material:logout:message}') ?><p>
2020
</main>
2121

themes/material/default/selectidp-links.php

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,16 @@ function setSelectedIdp(id) {
5656
$name = htmlspecialchars($this->t($idp['name']));
5757
$idpId = htmlspecialchars($idp['entityid']);
5858
?>
59-
<div class="mdl-card mdl-shadow--8dp margin">
59+
<div class="mdl-card mdl-shadow--8dp row-aware"
60+
title="<?= $this->t('{material:selectidp:logo}', ['{idpName}' => $name]) ?>">
6061
<div class="mdl-card__media white-bg fixed-height">
61-
<button class="mdl-button fill-parent no-padding" value="<?= $name ?>"
62+
<button class="mdl-button fill-parent" value="<?= $name ?>"
6263
onclick="setSelectedIdp('<?= $idpId ?>')">
63-
<img src="<?= empty($idp['logoURL']) ? '/module.php/material/default-logo.png'
64+
<img class="scale-to-parent"
65+
src="<?= empty($idp['logoURL']) ? '/module.php/material/default-logo.png'
6466
: $idp['logoURL'] ?>">
6567
</button>
6668
</div>
67-
<div class="mdl-card__actions mdl-card--border">
68-
<button class="mdl-button mdl-button--colored fill-parent"
69-
value="<?= $name ?>"
70-
onclick="setSelectedIdp('<?= $idpId ?>')">
71-
<!-- div added because of https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers
72-
TODO: move properties to button and remove div if
73-
these bugs are resolved. -->
74-
<div layout-children="row" child-spacing="space-between">
75-
<span>
76-
<?= $this->t('{material:selectidp:button_login}', ['{idpName}' => $name]) ?>
77-
</span>
78-
79-
<i class="material-icons">exit_to_app</i>
80-
</div>
81-
</button>
82-
</div>
8369
</div>
8470
<?php
8571
}
@@ -88,14 +74,14 @@ function setSelectedIdp(id) {
8874
<?php
8975
foreach ($disabledIdps as $idp) {
9076
?>
91-
<div class="mdl-card mdl-shadow--2dp margin disabled" title="Planned for a future release.">
92-
<div class="mdl-card__media white-bg fixed-height" layout-children="row" child-spacing="center">
93-
<img src="<?= empty($idp['logoURL']) ? '/module.php/material/default-logo.png'
77+
<div class="mdl-card mdl-shadow--2dp disabled row-aware"
78+
title="<?= $this->t('{material:selectidp:future}') ?>">
79+
<div class="mdl-card__media white-bg fixed-height" layout-children="row"
80+
child-spacing="center">
81+
<img class="scale-to-parent"
82+
src="<?= empty($idp['logoURL']) ? '/module.php/material/default-logo.png'
9483
: $idp['logoURL'] ?>">
9584
</div>
96-
<div class="mdl-card__supporting-text" layout-children="row" child-spacing="center">
97-
<?= $this->t('{material:selectidp:button_login_disabled}') ?>
98-
</div>
9985
</div>
10086
<?php
10187
}

www/styles.2.1.0.css

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
height: 100vh;
44
}
55

6-
.mdl-layout__content {
7-
padding: 1em;
8-
display: flex;
9-
align-items: center;
10-
justify-content: center;
11-
}
12-
136
[layout-children=row] {
147
display: flex;
158
flex-direction: row;
@@ -38,6 +31,12 @@
3831
justify-content: center;
3932
}
4033

34+
form p.error {
35+
display: flex;
36+
flex-direction: row;
37+
align-items: center;
38+
}
39+
4140
.margin {
4241
margin: 1em;
4342
}
@@ -55,8 +54,43 @@
5554
height: 100%;
5655
}
5756

58-
.no-padding {
59-
padding: 0px;
57+
.scale-to-parent {
58+
max-width: 90%;
59+
}
60+
61+
/* out-of-box styles for the cards don't work well when there are many cards */
62+
.mdl-card {
63+
width: initial;
64+
margin: 1em;
65+
}
66+
67+
/* phones (2 cards / row) */
68+
@media only screen and (min-width : 320px) {
69+
.mdl-card.row-aware {
70+
min-width: calc(50% - 2em);
71+
max-width: calc(50% - 2em);
72+
}
73+
}
74+
/* phones, small tablets, landscape (3 cards / row) */
75+
@media only screen and (min-width : 600px) {
76+
.mdl-card.row-aware {
77+
min-width: calc(33% - 2em);
78+
max-width: calc(33% - 2em);
79+
}
80+
}
81+
/* tablets, small desktops (4 cards / row) */
82+
@media only screen and (min-width : 850px) {
83+
.mdl-card.row-aware {
84+
min-width: calc(25% - 2em);
85+
max-width: calc(25% - 2em);
86+
}
87+
}
88+
/* desktops (5 cards / row) */
89+
@media only screen and (min-width : 1024px) {
90+
.mdl-card.row-aware {
91+
min-width: calc(20% - 2em);
92+
max-width: calc(20% - 2em);
93+
}
6094
}
6195

6296
.mdl-card.disabled {
@@ -95,10 +129,6 @@
95129
font-size: 12px
96130
}
97131

98-
.mdl-card.unfix-width {
99-
width: initial;
100-
}
101-
102132
[flex] {
103133
flex: 1;
104134
}

0 commit comments

Comments
 (0)