Plugin: Azure AD: Diversify exception to be more explicit regarding empty fields in Azure profile - refs BT#21739

pull/5557/head
Yannick Warnier 1 year ago
parent 4a3624a25e
commit 0c299d9d25
  1. 7
      plugin/azure_active_directory/src/callback.php

@ -64,8 +64,11 @@ try {
// We use the e-mail to authenticate the user, so check that at least one // We use the e-mail to authenticate the user, so check that at least one
// e-mail source exists // e-mail source exists
if (empty($me['mail']) || empty($me['mailNickname'])) { if (empty($me['mail'])) {
throw new Exception('Mail empty'); throw new Exception('The mail field is empty in Azure AD and is needed to set the organisation email for this user.');
}
if (empty($me['mailNickname'])) {
throw new Exception('The mailNickname field is empty in Azure AD and is needed to set the unique Azure ID for this user.');
} }
$extraFieldValue = new ExtraFieldValue('user'); $extraFieldValue = new ExtraFieldValue('user');

Loading…
Cancel
Save