Add identity providers for agents and client contacts: Admin, Identity Providers under Integrations adds Microsoft 365, Google Workspace and Nextcloud (OIDC Identity Provider app) sign-in buttons and IMAP mail-password sign-in, each for agents, client contacts or both and for the email domains listed; no account is created by signing in; Microsoft, Google and Nextcloud stand in for ITFlow two-step sign-in while IMAP still asks for the code; a provider can be required, turning off password sign-in on its domains with passkeys and administrator passwords still working; credentials stay locked after a provider or mail password sign-in until the ITFlow password is typed; the client portal Microsoft Entra single sign-on moves to a Microsoft 365 provider keeping its redirect address; database 4.2.5 adds identity_providers and drops the old Entra settings; 26.12.3 changelog entries

This commit is contained in:
johnnyq
2026-11-29 20:13:10 -05:00
parent 626f472990
commit fffa5680db
32 changed files with 1671 additions and 340 deletions

View File

@@ -3,7 +3,7 @@
* Client Portal
* Joining - from an invite (ours, or a colleague's in the portal) or the link
* to finish signing up: ?invite=&token=. The person puts in their name, job
* title, phone and a password - or, when Microsoft 365 sign-in is set up,
* title, phone and a password - or, when an identity provider signs in their address,
* chooses that instead - and is made a contact who can sign in
* (portalInviteAccept(), functions/portal_invite.php). Then they sign in on
* the usual page. A link that has run out, been used or cancelled says so,
@@ -43,6 +43,8 @@ $error = '';
$in = ['name' => '', 'title' => '', 'phone' => ''];
if ($invite && $link['state'] === 'pending') {
// Only an identity provider that signs in their address (functions/identity_provider.php)
$methods = portalSignInMethods($invite['invite_email']);
$who = portalInviteWho($invite['invite_email'], $invite['invite_client_id']);
$in['name'] = trim((string) $invite['invite_name']) !== '' ? (string) $invite['invite_name'] : (string) ($who['name'] ?? '');
@@ -61,7 +63,7 @@ if ($invite && $link['state'] === 'pending') {
if ($contact_id) {
$first = strtok(trim(preg_replace('/\s+/', ' ', $in['name'])), ' ');
$_SESSION['login_message'] = "Welcome, $first - your account is ready. " . (isset($methods[$method]) && $method === 'azure'
? 'Sign in with your Microsoft 365 account below.'
? 'Sign in with your ' . identityProviderContactsWording($invite['invite_email']) . ' account below.'
: 'Sign in with ' . $invite['invite_email'] . ' and your new password.');
$_SESSION['login_message_type'] = 'success';
redirect("/login.php");
@@ -169,7 +171,7 @@ $title = $state === 'pending' ? ($signup ? 'Finish signing up' : 'Join ' . $invi
<button type="submit" class="btn btn-primary w-100 mb-2"><i class="fas fa-check me-2"></i><?= $signup ? 'Create my account' : 'Join' ?></button>
<?php if (isset($methods['azure'])) { ?>
<div class="text-center small text-body-secondary my-2">or, with no password here</div>
<button type="submit" class="btn btn-outline-secondary w-100 mb-3" name="method" value="azure" formnovalidate data-join-microsoft><i class="fab fa-microsoft me-2"></i>Use My Microsoft 365 Account</button>
<button type="submit" class="btn btn-outline-secondary w-100 mb-3" name="method" value="azure" formnovalidate data-join-microsoft><i class="fas fa-id-badge me-2"></i>Use My <?= escapeHtml(identityProviderContactsWording($invite['invite_email'])) ?> Account</button>
<?php } ?>
</form>