use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Request;
use Mobomo\AzureHmacAuth\AzureHMACMiddleware;
$azureHMACMiddleware = new AzureHMACMiddleware('<secret key>');
$handlerStack = HandlerStack::create();
$handlerStack->push($azureHMACMiddleware, 'hmac-auth');
$resourceEndpoint = "https://<hostname>.communication.azure.com";
$requestPath = "/emails:send?api-version=2023-03-31";
$requestUri = "{$resourceEndpoint}{$requestPath}";
$serializedBody = "<json>";
$client = new Client([
'handler' => $handlerStack,
]);
$requestMessage = new Request(
'POST',
$requestUri,
array(
'Content-Type' => 'application/json',
),
$serializedBody
);
$response = $client->send($requestMessage);
-
Notifications
You must be signed in to change notification settings - Fork 0
Guzzle middleware for Azure HMAC auth
License
mobomo/guzzle-azure-hmac-auth
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Guzzle middleware for Azure HMAC auth
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published