mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
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:
@@ -435,10 +435,22 @@ function vaultUnlock($user_id, #[\SensitiveParameter] $password) {
|
||||
return [true, ''];
|
||||
}
|
||||
|
||||
/*
|
||||
* Why the vault is locked, as it is said to the agent - how they signed in without the password
|
||||
* that opens it (login.php): a passkey that can't, an identity provider, or their mail password.
|
||||
*/
|
||||
function vaultLockedReason() {
|
||||
$via = trim((string) ($_SESSION['signed_in_via'] ?? ''));
|
||||
return [
|
||||
'provider' => 'you signed in with ' . ($via !== '' ? $via : 'an identity provider') . ', which can\'t open them',
|
||||
'imap' => 'you signed in with your mail password, which can\'t open them',
|
||||
][$_SESSION['signed_in_with'] ?? ''] ?? 'you signed in with a passkey that can\'t open them';
|
||||
}
|
||||
|
||||
/** The note in a credential window while the vault is locked - with the button that unlocks it (js/credentials.js). */
|
||||
function vaultLockedAlertHtml() {
|
||||
return '<div class="alert alert-warning small d-flex align-items-center gap-2"><i class="fas fa-lock"></i>'
|
||||
. '<span class="flex-grow-1">Your credentials are locked - you signed in with a passkey that can\'t open them.</span>'
|
||||
. '<span class="flex-grow-1">Your credentials are locked - ' . escapeHtml(vaultLockedReason()) . '.</span>'
|
||||
. '<button type="button" class="btn btn-sm btn-warning text-nowrap" data-vault-unlock><i class="fas fa-unlock me-1"></i>Unlock</button></div>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user