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
- Host: GitHub
- URL: https://github.com/mobomo/guzzle-azure-hmac-auth
- Owner: mobomo
- License: mit
- Created: 2023-06-06T18:35:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-06T18:57:51.000Z (about 3 years ago)
- Last Synced: 2025-10-14T04:23:42.570Z (9 months ago)
- Topics: authentication, authentication-middleware, azure, guzzle, guzzle-middleware, hmac
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 24
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```