An open API service indexing awesome lists of open source software.

https://github.com/mobomo/guzzle-azure-hmac-auth

Guzzle middleware for Azure HMAC auth
https://github.com/mobomo/guzzle-azure-hmac-auth

authentication authentication-middleware azure guzzle guzzle-middleware hmac

Last synced: 2 months ago
JSON representation

Guzzle middleware for Azure HMAC auth

Awesome Lists containing this project

README

          

# Usage

```php
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Request;
use Mobomo\AzureHmacAuth\AzureHMACMiddleware;

$azureHMACMiddleware = new AzureHMACMiddleware('');

$handlerStack = HandlerStack::create();
$handlerStack->push($azureHMACMiddleware, 'hmac-auth');

$resourceEndpoint = "https://.communication.azure.com";
$requestPath = "/emails:send?api-version=2023-03-31";
$requestUri = "{$resourceEndpoint}{$requestPath}";

$serializedBody = "";

$client = new Client([
'handler' => $handlerStack,
]);
$requestMessage = new Request(
'POST',
$requestUri,
array(
'Content-Type' => 'application/json',
),
$serializedBody
);

$response = $client->send($requestMessage);
```