Skip to content

Commit b3f3006

Browse files
authored
Merge pull request #30 from RRZE-Webteam/dev
Dev
2 parents f89a2cb + 0e04e55 commit b3f3006

File tree

3 files changed

+10
-59
lines changed

3 files changed

+10
-59
lines changed

includes/Authenticate.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ public function authenticate($user, $userLogin)
103103
// The entityID of the IdP the user is authenticated against.
104104
$samlSpIdp = $this->authSimple->getAuthData('saml:sp:IdP');
105105

106+
// Get the IdP Metadata.
107+
$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler();
108+
$idpMetadata = $metadata->getMetaData($samlSpIdp, 'saml20-idp-remote');
109+
$locale = get_locale();
110+
$lang = substr($locale, 0, 2);
111+
$idpName = $idpMetadata['name'][$lang] ?? '';
112+
106113
// Retrieve the attributes of the current user.
107114
// If the user isn't authenticated, an empty array will be returned.
108115
if (empty($_atts = $this->authSimple->getAttributes())) {
@@ -187,7 +194,7 @@ public function authenticate($user, $userLogin)
187194
$firstName = $firstName ?: $atts['givenName'] ?? '';
188195

189196
$organizationName = $atts['o'] ?? '';
190-
$organizationName = $organizationName ?: $atts['organizationName'] ?? '';
197+
$organizationName = $organizationName ?: $atts['organizationName'] ?? $idpName;
191198

192199
$eduPersonAffiliation = $atts['eduPersonAffiliation'] ?? '';
193200
$eduPersonScopedAffiliation = $atts['eduPersonScopedAffiliation'] ?? '';

includes/Utils.php

-56
This file was deleted.

rrze-sso.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: RRZE SSO
55
Plugin URI: https://github.com/RRZE-Webteam/rrze-sso
66
Description: Single-Sign-On (SSO) SAML-Integrations-Plugin für WordPress.
7-
Version: 1.6.6
7+
Version: 1.6.7
88
Author: RRZE-Webteam
99
Author URI: https://blogs.fau.de/webworking/
1010
License: GNU General Public License v2
@@ -18,7 +18,7 @@
1818
defined('ABSPATH') || exit;
1919

2020
const RRZE_PHP_VERSION = '8.0';
21-
const RRZE_WP_VERSION = '6.2';
21+
const RRZE_WP_VERSION = '6.5';
2222

2323
/**
2424
* SPL Autoloader (PSR-4).

0 commit comments

Comments
 (0)