Hi @Kyle Jeynes
we are sorry to hear you were facing this issue. Based on your Stack overflow post it looks like you were able to resolve your issue by using the correct syntax locally in your NGINX configuration. Sharing your solution here so it helps others who might come across this same issue.
"Ok the issue I had was that locally, this didn't technically work.
In my NGINX configuration, I force a XDEBUG_SESSION_START
header in the requests to enable local debug from the mobile application etc.
This lead to me using the WRONG syntax locally, I was missing the !
operator:
if (!$request->hasValidSignature()) {
abort(401);
}
This lead to Azure working but not my local so I instead wrote this function to ignore additional params for local dev:
private function hasValidSignature(): bool
{
$url = rtrim(request()->url() . '?' . Arr::query(Arr::except(request()->query(), ['signature', 'XDEBUG_SESSION_START'])), '?');
$signature = hash_hmac('sha256', $url, app()->make('config')->get('app.key'));
return hash_equals($signature, (string) request()->query('signature')) && !(now()->getTimestamp() > (string) request()->query('expires'));
}
Thanks again for sharing the solution that worked for you.
-Grace