From 480e9131519c32ea302bfdcd23b687e2a194c0ec Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 11 Jul 2022 12:20:00 +0200 Subject: [PATCH] add uid to selectable username attributes --- api/src/Auth/Saml.php | 6 +++++- setup/templates/default/config.tpl | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/Auth/Saml.php b/api/src/Auth/Saml.php index 299b40c184..723d790686 100644 --- a/api/src/Auth/Saml.php +++ b/api/src/Auth/Saml.php @@ -102,6 +102,7 @@ class Saml implements BackendSSO const eduPersonPricipalName = 'urn:oid:1.3.6.1.4.1.5923.1.1.1.6'; const eduPersonUniqueId = 'urn:oid:1.3.6.1.4.1.5923.1.1.1.13'; const emailAddress = 'urn:oid:0.9.2342.19200300.100.1.3'; + const uid = 'urn:oid:0.9.2342.19200300.100.1.1'; const firstName = 'urn:oid:2.5.4.42'; const lastName = 'urn:oid:2.5.4.4'; @@ -467,6 +468,7 @@ class Saml implements BackendSSO 'eduPersonPricipalName' => self::eduPersonPricipalName, 'eduPersonUniqueId' => self::eduPersonUniqueId, 'emailAddress' => self::emailAddress, + 'uid' => self::uid, 'firstName' => self::firstName, 'lastName' => self::lastName, ]; @@ -560,8 +562,10 @@ class Saml implements BackendSSO return self::eduPersonUniqueId; case 'emailAddress': return self::emailAddress; + case 'uid': + return self::uid; case 'customOid': - return 'urn:oid:'.$config['saml_username_oid'] ?: self::emailAddress; + return !empty($config['saml_username_oid']) ? 'urn:oid:'.$config['saml_username_oid'] : self::emailAddress; } return self::emailAddress; } diff --git a/setup/templates/default/config.tpl b/setup/templates/default/config.tpl index b6b488e877..dcb9261c3e 100644 --- a/setup/templates/default/config.tpl +++ b/setup/templates/default/config.tpl @@ -590,6 +590,7 @@ +