Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/future/PhabricatorDuoFuture.php
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | if (!$this->future) { | ||||
$corpus = implode("\n", $corpus); | $corpus = implode("\n", $corpus); | ||||
$signature = hash_hmac( | $signature = hash_hmac( | ||||
'sha1', | 'sha1', | ||||
$corpus, | $corpus, | ||||
$this->secretKey->openEnvelope()); | $this->secretKey->openEnvelope()); | ||||
$signature = new PhutilOpaqueEnvelope($signature); | $signature = new PhutilOpaqueEnvelope($signature); | ||||
if ($http_method === 'GET') { | |||||
$uri->setQueryParams($data); | |||||
$data = array(); | |||||
} | |||||
epriestley: Duo is particular about this. `/auth_status` is a GET request with parameters. | |||||
$future = id(new HTTPSFuture($uri, $data)) | $future = id(new HTTPSFuture($uri, $data)) | ||||
->setHTTPBasicAuthCredentials($this->integrationKey, $signature) | ->setHTTPBasicAuthCredentials($this->integrationKey, $signature) | ||||
->setMethod($http_method) | ->setMethod($http_method) | ||||
->addHeader('Accept', 'application/json') | ->addHeader('Accept', 'application/json') | ||||
->addHeader('Date', $date); | ->addHeader('Date', $date); | ||||
$timeout = $this->getTimeout(); | $timeout = $this->getTimeout(); | ||||
if ($timeout) { | if ($timeout) { | ||||
Show All 28 Lines |
Duo is particular about this. /auth_status is a GET request with parameters.