FastComments.com

FastComments PHP SSO SDK


ื–ื” ื”-SDK ื”ืจืฉืžื™ ื‘-PHP ืขื‘ื•ืจ SSO ืฉืœ FastComments.

SDK ื‘-PHP ืœืื™ื ื˜ื’ืจืฆื™ื” ืฉืœ SSO ืขื FastComments

ืžืื’ืจ

ืฆืคื” ื‘-GitHub


ื”ืชืงื ื” Internal Link

composer require fastcomments/sso

ืฉื™ืžื•ืฉ Internal Link

SSO ืคืฉื•ื˜

SSO ืคืฉื•ื˜ ืงืœ ืœืฉื™ืžื•ืฉ, ืืš ืžืกืคืง ืื‘ื˜ื—ื” ืคื—ื•ืชื” ื‘ื”ืฉื•ื•ืื” ืœ-SSO ืžืื•ื‘ื˜ื—:

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) { /* ื˜ืคืœ ื‘ื”ืชื—ื‘ืจื•ืช */ },
    function($url) { /* ื˜ืคืœ ื‘ื”ืชื ืชืงื•ืช */ }
);

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

SSO ืžืื•ื‘ื˜ื—

SSO ืžืื•ื‘ื˜ื— ืžืกืคืง ืื‘ื˜ื—ื” ืžืฉื•ืคืจืช ื‘ืืžืฆืขื•ืช ืื™ืžื•ืช 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();

ืชื™ืขื•ื“ Internal Link


ืœืชื™ืขื•ื“ ื”ืžืœื ืขืœ SSO ืฉืœ FastComments, ืขื™ื™ื ื• ื‘-ืชื™ืขื•ื“ FastComments.

ื–ืงื•ืงื™ื ืœืขื–ืจื”?

ืื ืืชื ื ืชืงืœื™ื ื‘ื‘ืขื™ื•ืช ืื• ื™ืฉ ืœื›ื ืฉืืœื•ืช ืœื’ื‘ื™ ื”-PHP SSO SDK, ืื ื:

ืชืจื•ืžื•ืช

ืชืจื•ืžื•ืช ืžืชืงื‘ืœื•ืช ื‘ื‘ืจื›ื”! ืื ื ื‘ืงืจื• ื‘-ืžืื’ืจ GitHub ืœืงื‘ืœืช ื”ื ื—ื™ื•ืช ืœืชืจื•ืžื”.