CMS & System Integrations Free

WEB-PHP CMS Integration

Integration guide for WEB-PHP CMS & WPMobile with SPChat: HMAC SSO tokens, live database connection testing, and automatic role mapping.

Module ID: web-php-cms
Version: v1.0.3
Size: 2 MB
Target Directory: modules/web-php-cms

The WEB-PHP CMS Integration Module provides seamless Single Sign-On (SSO) and automatic user account synchronization for WEB-PHP CMS / WPMobile version 2.0.0 and higher. When members log in on your WEB-PHP CMS site, they can enter SPChat with one click without re-typing their password.

[!TIP] Free Module: Included in all SPChat licenses at no extra charge.


Core Features


Step-by-Step Configuration Guide

Step 1: Configure Database Connection

Enter your WEB-PHP CMS MySQL database connection details into the module settings:

Click Test Connection to verify database connectivity.

Step 2: Generate SSO Secret & Save in CMS Settings

  1. Click Generate under SSO Token Configuration in the SPChat Admin Panel to create a secure secret key.
  2. Save the module settings in SPChat.
  3. Open your WEB-PHP CMS / WPMobile (v2.0.0+) admin dashboard and paste the copied SSO token into the dedicated chat integration settings. No source code modifications are required!

[!NOTE] Notice for Custom External Websites: If you wish to integrate SPChat SSO into a custom external website or non-standard PHP application, you can use the sample PHP snippet below (e.g., in your site’s header.php):

<?php
// Sample snippet for external custom PHP websites (e.g. embed in header.php)
$sso_secret = 'YOUR_SSO_SECRET_KEY_HERE';
$chat_url   = 'https://chat.yourdomain.com';

if (isset($_SESSION['sesswebphp']) || !empty($_SESSION['username']) || !empty($username)) {
    $cms_username = $_SESSION['username'] ?? $username ?? '';
    if ($cms_username !== '') {
        $payload = base64_encode(json_encode(['u' => $cms_username, 't' => time()]));
        $sig     = hash_hmac('sha256', $payload, $sso_secret);
        $chat_sso_url = $chat_url . '/sso/web-php-cms?sso_token=' . urlencode($payload) . '&sso_sig=' . $sig;
    }
}
?>
<?php if (!empty($chat_sso_url)): ?>
    <a href="<?= $chat_sso_url ?>" target="_blank" class="btn-chat">Open Chat</a>
<?php endif; ?>

Frequently Asked Questions (FAQ)

Are SSO tokens secure against tampering?

Yes. Every SSO token is cryptographically signed using HMAC-SHA256 with a unique secret and timestamped to prevent replay attacks.

Do users need pre-created SPChat accounts?

No. When Auto-Registration is enabled, SPChat automatically provisions user accounts and assigns roles upon first SSO redirect.

Still unsure? Test the chat yourself.

The live demo shows the interface and chat flow without installation. Join the waitlist for your own chat.