Skip to content

Commit

Permalink
Plugin: Azure AD: Diversify exception to be more explicit regarding e…
Browse files Browse the repository at this point in the history
…mpty fields in Azure profile - refs BT#21739
  • Loading branch information
ywarnier committed May 28, 2024
1 parent 4a3624a commit 0c299d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugin/azure_active_directory/src/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@

// We use the e-mail to authenticate the user, so check that at least one
// e-mail source exists
if (empty($me['mail']) || empty($me['mailNickname'])) {
throw new Exception('Mail empty');
if (empty($me['mail'])) {
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');
Expand Down

0 comments on commit 0c299d9

Please sign in to comment.