FastComments.com

FastComments PHP SSO SDK

Dette er den officielle PHP SSO SDK til FastComments.

PHP SDK til FastComments SSO-integration

Arkiv

Se på GitHub


Installation Internal Link

composer require fastcomments/sso

Brug Internal Link


Simpel SSO

Simpel SSO er let at bruge, men giver mindre sikkerhed end Sikker SSO:

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

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

// Med URL-baseret log ind/log ud
$sso = FastCommentsSSO::createWithUrls(
    null,
    $userData,
    'https://example.com/login',
    'https://example.com/logout'
);

// Eller med callbacks
$sso = FastCommentsSSO::createWithCallbacks(
    $userData,
    function($url) { /* Håndter log ind */ },
    function($url) { /* Håndter log ud */ }
);

// Hent tokenet, der skal sendes til FastComments
$token = $sso->prepareToSend();

Sikker SSO

Sikker SSO giver forbedret sikkerhed med HMAC-verifikation:

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

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

// Tilføj valgfri data om nødvendigt
$userData->isAdmin = true;
$userData->groupIds = ['group-1', 'group-2'];

// Opret SSO-objektet med din API-nøgle
$sso = FastCommentsSSO::createSecure('your-api-key', $userData);

// Hent tokenet, der skal sendes til FastComments
$token = $sso->prepareToSend();

Dokumentation Internal Link


For fuld dokumentation om FastComments SSO, se venligst FastComments-dokumentationen.

Brug for hjælp?

Hvis du støder på problemer eller har spørgsmål om PHP SSO SDK'en, så:

Bidrag

Bidrag er velkomne! Besøg venligst GitHub-repositoriet for retningslinjer for bidrag.