add uid to selectable username attributes

This commit is contained in:
ralf 2022-07-11 12:20:00 +02:00
parent a739539a03
commit 480e913151
2 changed files with 6 additions and 1 deletions

View File

@ -102,6 +102,7 @@ class Saml implements BackendSSO
const eduPersonPricipalName = 'urn:oid:1.3.6.1.4.1.5923.1.1.1.6'; 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 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 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 firstName = 'urn:oid:2.5.4.42';
const lastName = 'urn:oid:2.5.4.4'; const lastName = 'urn:oid:2.5.4.4';
@ -467,6 +468,7 @@ class Saml implements BackendSSO
'eduPersonPricipalName' => self::eduPersonPricipalName, 'eduPersonPricipalName' => self::eduPersonPricipalName,
'eduPersonUniqueId' => self::eduPersonUniqueId, 'eduPersonUniqueId' => self::eduPersonUniqueId,
'emailAddress' => self::emailAddress, 'emailAddress' => self::emailAddress,
'uid' => self::uid,
'firstName' => self::firstName, 'firstName' => self::firstName,
'lastName' => self::lastName, 'lastName' => self::lastName,
]; ];
@ -560,8 +562,10 @@ class Saml implements BackendSSO
return self::eduPersonUniqueId; return self::eduPersonUniqueId;
case 'emailAddress': case 'emailAddress':
return self::emailAddress; return self::emailAddress;
case 'uid':
return self::uid;
case 'customOid': 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; return self::emailAddress;
} }

View File

@ -590,6 +590,7 @@
<option value="eduPersonPrincipalName"{selected_saml_username_eduPersonPrincipalName}>eduPersonPrincipalName</option> <option value="eduPersonPrincipalName"{selected_saml_username_eduPersonPrincipalName}>eduPersonPrincipalName</option>
<option value="eduPersonUniqueId"{selected_saml_username_eduPersonUniqueId}>eduPersonUniqueId</option> <option value="eduPersonUniqueId"{selected_saml_username_eduPersonUniqueId}>eduPersonUniqueId</option>
<option value="emailAddress"{selected_saml_username_emailAddress}>emailAddress</option> <option value="emailAddress"{selected_saml_username_emailAddress}>emailAddress</option>
<option value="uid"{selected_saml_username_uid}>uid</option>
<option value="customOid"{selected_saml_username_customOid}>{lang_custom_OID}</option> <option value="customOid"{selected_saml_username_customOid}>{lang_custom_OID}</option>
</select> </select>
<input name="newsettings[saml_username_oid]" value="{value_saml_username_oid}" placeholder="urn:oid:x.x.x.x" size="40" /> <input name="newsettings[saml_username_oid]" value="{value_saml_username_oid}" placeholder="urn:oid:x.x.x.x" size="40" />