Skip to content

Commit 0c299d9

Browse files
committed
Plugin: Azure AD: Diversify exception to be more explicit regarding empty fields in Azure profile - refs BT#21739
1 parent 4a3624a commit 0c299d9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugin/azure_active_directory/src/callback.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@
6464

6565
// We use the e-mail to authenticate the user, so check that at least one
6666
// e-mail source exists
67-
if (empty($me['mail']) || empty($me['mailNickname'])) {
68-
throw new Exception('Mail empty');
67+
if (empty($me['mail'])) {
68+
throw new Exception('The mail field is empty in Azure AD and is needed to set the organisation email for this user.');
69+
}
70+
if (empty($me['mailNickname'])) {
71+
throw new Exception('The mailNickname field is empty in Azure AD and is needed to set the unique Azure ID for this user.');
6972
}
7073

7174
$extraFieldValue = new ExtraFieldValue('user');

0 commit comments

Comments
 (0)