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

@@ -96,7 +96,7 @@ try {
<script src="<?= staticFileUrl('/js/app.js') ?>"></script>
<script src="<?= staticFileUrl('/js/picture_field.js') ?>"></script>
<?php
// Signed in with a passkey that couldn't open the credential vault - their password unlocks it (vaultUnlock(), js/credentials.js)
// Signed in without the password that opens the credential vault - a passkey that can't, an identity provider or a mail password; their password unlocks it (vaultUnlock(), js/credentials.js)
try {
$itflow_vault_locked = function_exists('vaultLocked') && vaultLocked();
} catch (Throwable $e) {
@@ -112,7 +112,7 @@ if ($itflow_vault_locked) { ?>
</div>
<form data-vault-unlock-form autocomplete="off">
<div class="modal-body">
<p>You signed in with a passkey that can't open the credential vault, so usernames, passwords and 2FA codes are locked. Type your password to unlock them until you sign out.</p>
<p><?= escapeHtml(ucfirst(vaultLockedReason())) ?>, so your usernames, passwords and 2FA codes are locked. Type your ITFlow password to unlock them until you sign out.</p>
<div data-vault-unlock-message></div>
<label class="form-label">Your password <strong class="text-danger">*</strong></label>
<div class="input-group">

View File

@@ -1,7 +1,7 @@
<?php
// Query Settings
$sql_settings = mysqli_query($mysqli, "SELECT config_azure_client_id, config_azure_client_secret, config_client_portal_enable, config_client_portal_require_mfa,
$sql_settings = mysqli_query($mysqli, "SELECT config_client_portal_enable, config_client_portal_require_mfa,
config_current_database_version, config_default_calendar, config_default_expense_account,
config_default_expense_payment_method, config_default_hourly_rate,
config_default_net_terms, config_default_payment_account, config_default_payment_method,
@@ -39,10 +39,6 @@ $row = mysqli_fetch_assoc($sql_settings);
// Database version
DEFINE("CURRENT_DATABASE_VERSION", $row['config_current_database_version']);
// Microsoft OAuth
$config_azure_client_id = $row['config_azure_client_id'];
$config_azure_client_secret = $row['config_azure_client_secret'];
// Mail - SMTP
$config_smtp_provider = $row['config_smtp_provider'];
$config_smtp_host = $row['config_smtp_host'];

View File

@@ -77,7 +77,7 @@ if (!hash_equals($session_stamp_current, (string) ($_SESSION['user_session_stamp
// up page. Signing in only sends them there; this is what keeps them there, including when
// an admin requires MFA, or resets it, on an agent who is already signed in. A passkey sign-in is
// two-step sign-in already (functions/passkey.php), so it is left be.
if ($session_user_config_force_mfa === 1 && trim((string) $session_token) === '' && ($_SESSION['signed_in_with'] ?? '') !== 'passkey' && !requestIsMfaSetup([
if ($session_user_config_force_mfa === 1 && trim((string) $session_token) === '' && !in_array($_SESSION['signed_in_with'] ?? '', ['passkey', 'provider'], true) && !requestIsMfaSetup([
'agent/user/mfa_enforcement.php' => [[[], []]],
'agent/user/post.php' => [[[], ['csrf_token', 'enable_mfa', 'verify_code']], [['logout'], []]],
])) {