Appearance
Webhooks
This document provides an overview of the supported webhook events in the Carro\SsoClient\Events\Webhooks package.
Supported events
User events
| Name | Description |
|---|---|
| UserLoggedOut | Triggered when a user logs out. |
| UserEmailChanged | Triggered when a user updates their email address. |
| UserPhoneChanged | Triggered when a user updates their phone number. |
| UserPasswordChanged | Triggered when a user updates their password. |
| UserBasicInfoChanged | Triggered when a user updates their basic info. |
Application user events
| Name | Description |
|---|---|
| ApplicationUserAdded | Triggered when a user is added. |
| ApplicationUserTerminated | Triggered when a user is removed. |
Sample webhook events
You can check sample webhook events in the Auth Dashboard under the webhooks section:
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';
}