FastComments.com

FastComments PHP SSO SDK

Questo è l'SDK PHP ufficiale per l'SSO di FastComments.

SDK PHP per l'integrazione SSO di FastComments

Repository

Visualizza su GitHub


Agenti di programmazione AI Internal Link

skills.sh

Fornisci al tuo agente di codifica il contesto FastComments di cui ha bisogno - widget, configurazione, Secure SSO, la REST API e gli SDK:

npx skills add fastcomments/skills

Funziona con Claude Code, Codex, Cursor, Copilot, Gemini e tutti gli altri agenti supportati dal skills CLI.

Installazione Internal Link

composer require fastcomments/sso

Utilizzo Internal Link

SSO semplice

Lo SSO semplice è facile da usare, ma offre meno sicurezza rispetto allo SSO sicuro:

use FastComments\SSO\FastCommentsSSO;
use FastComments\SSO\SimpleSSOUserData;

// Create user data
$userData = SimpleSSOUserData::create(
    'username123',
    'user@example.com',
    'https://example.com/avatar.png'
);

// With URL-based login/logout
$sso = FastCommentsSSO::createWithUrls(
    null,
    $userData,
    'https://example.com/login',
    'https://example.com/logout'
);

// Or with callbacks
$sso = FastCommentsSSO::createWithCallbacks(
    $userData,
    function($url) { /* Gestisci il login */ },
    function($url) { /* Gestisci il logout */ }
);

// Get the token to pass to FastComments
$token = $sso->prepareToSend();

SSO sicuro

Lo SSO sicuro offre una maggiore sicurezza tramite la verifica HMAC:

use FastComments\SSO\FastCommentsSSO;
use FastComments\SSO\SecureSSOUserData;

// Create user data
$userData = SecureSSOUserData::create(
    'user-123',
    'user@example.com',
    'username123',
    'https://example.com/avatar.png'
);

// Add optional data if needed
$userData->isAdmin = true;
$userData->groupIds = ['group-1', 'group-2'];

// Create the SSO object with your API key
$sso = FastCommentsSSO::createSecure('your-api-key', $userData);

// Get the token to pass to FastComments
$token = $sso->prepareToSend();

Documentazione Internal Link

Per la documentazione completa sul SSO di FastComments, consultare la documentazione di FastComments.

Hai bisogno di aiuto?

Se riscontri problemi o hai domande sul PHP SSO SDK, per favore:

Contribuire

I contributi sono benvenuti! Visita il repository GitHub per le linee guida sui contributi.