[Web] add mTLS Authentication

This commit is contained in:
FreddleSpl0it
2024-02-13 11:17:49 +01:00
parent a794c1ba6c
commit 75eb1c42d5
15 changed files with 304 additions and 63 deletions
+20
View File
@@ -26,6 +26,26 @@ if ($iam_provider){
}
}
if (isset($_GET['mutual_tls_login'])) {
$mutual_login_user = user_mutualtls_login();
if ($mutual_login_user != false) {
$_SESSION['mailcow_cc_username'] = $mutual_login_user;
$_SESSION['mailcow_cc_role'] = "user";
$http_parameters = explode('&', $_SESSION['index_query_string']);
unset($_SESSION['index_query_string']);
if (in_array('mobileconfig', $http_parameters)) {
if (in_array('only_email', $http_parameters)) {
header("Location: /mobileconfig.php?only_email");
die();
}
header("Location: /mobileconfig.php");
die();
}
header("Location: /user");
}
}
// SSO Domain Admin
if (!empty($_GET['sso_token'])) {
$username = domain_admin_sso('check', $_GET['sso_token']);