Skip to content

Webhooks

This document provides an overview of the supported webhook events in the Carro\SsoClient\Events\Webhooks package.

Supported events

User events

NameDescription
UserLoggedOutTriggered when a user logs out.
UserEmailChangedTriggered when a user updates their email address.
UserPhoneChangedTriggered when a user updates their phone number.
UserPasswordChangedTriggered when a user updates their password.
UserBasicInfoChangedTriggered when a user updates their basic info.

Application user events

NameDescription
ApplicationUserAddedTriggered when a user is added.
ApplicationUserTerminatedTriggered when a user is removed.

Sample webhook events

You can check sample webhook events in the Auth Dashboard under the webhooks section:

Auth Dashboard Webhooks

Signature verification

Instantiating the verifier

php
use Carro\SsoClient\Services\WebhookSignatureVerifier;

$verifier = new WebhookSignatureVerifier('your-api-secret');

// or from configuration
$verifier = new WebhookSignatureVerifier();

Verifying a webhook signature

php
$signature = $request->header('X-Signature');
$isValid = $verifier->verifyWebhook($request->getContent(), $signature);

if ($isValid) {
    echo 'Valid webhook signature';
} else {
    echo 'Invalid webhook signature';
}

The MIT License (MIT). Please see License File in the repository for more information.