false, "title" => "Missing parameters" ]; echo json_encode($response); exit; } // Get user from API key $sql = "SELECT * FROM user WHERE api_key = :apiKey"; $stmt = $db->prepare($sql); $stmt->bindValue(':apiKey', $apiKey); $result = $stmt->execute(); $user = $result->fetchArray(SQLITE3_ASSOC); // If the user is not found, return an error if (!$user) { $response = [ "success" => false, "title" => "Invalid API key" ]; echo json_encode($response); exit; } $userId = $user['id']; if ($userId !== 1) { $response = [ "success" => false, "title" => "Invalid user" ]; echo json_encode($response); exit; } $oidcConfiguration = wallos_get_effective_oidc_configuration($db); $oidc_settings = $oidcConfiguration['settings']; $response = [ "success" => true, "title" => "oidc_settings", "oidc_settings" => $oidc_settings, "oidc_enabled" => $oidcConfiguration['enabled'], "managed_fields" => $oidcConfiguration['managed_fields'], "notes" => $oidcConfiguration['notes'] ]; echo json_encode($response); $db->close(); } else { $response = [ "success" => false, "title" => "Invalid request method" ]; echo json_encode($response); exit; } ?>