Fixed oversights with basic authentication.
This commit is contained in:
parent
bda95c747c
commit
868a06f036
2 changed files with 14 additions and 0 deletions
|
@ -137,6 +137,19 @@ class AuthzContext {
|
|||
$this->expires = $info['expires'];
|
||||
}
|
||||
|
||||
public function dump(): array {
|
||||
return [
|
||||
'authed' => $this->authed,
|
||||
'error' => $this->error,
|
||||
'method' => $this->method,
|
||||
'type' => $this->type,
|
||||
'user' => $this->userId,
|
||||
'app' => $this->appId,
|
||||
'scope' => $this->scope,
|
||||
'expires' => $this->expires,
|
||||
];
|
||||
}
|
||||
|
||||
private function attemptBasicAppAuthInternal(string $remoteAddr, string $clientId, string $clientSecret = ''): void {
|
||||
try {
|
||||
$this->handleRpcResponse($this->rpcClient->procedure('hanyuu:oauth2:attemptAppAuth', [
|
||||
|
|
|
@ -124,6 +124,7 @@ class OAuth2Routes extends RouteHandler {
|
|||
if(!$authz->hasAuthed()) {
|
||||
$authzHeader = false;
|
||||
$authz->attemptBasicAppAuth(
|
||||
(string)filter_input(INPUT_SERVER, 'REMOTE_ADDR'),
|
||||
(string)$content->getParam('client_id'),
|
||||
(string)$content->getParam('client_secret')
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue