From 05eee805f686d91ec4b29d47bd275743b029171d Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Tue, 30 Oct 2018 16:05:04 +0100 Subject: [PATCH] fixed "WWW-Authenticate" header value format --- src/OAuth2Adapter.php | 2 +- test/OAuth2AdapterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OAuth2Adapter.php b/src/OAuth2Adapter.php index 455fcc2..999bcd6 100644 --- a/src/OAuth2Adapter.php +++ b/src/OAuth2Adapter.php @@ -82,7 +82,7 @@ public function unauthorizedResponse(ServerRequestInterface $request) : Response return ($this->responseFactory)() ->withHeader( 'WWW-Authenticate', - 'Bearer token-example' + 'Bearer realm="OAuth2 token"' ) ->withStatus(401); } diff --git a/test/OAuth2AdapterTest.php b/test/OAuth2AdapterTest.php index 51dd4a3..e1bdb3a 100644 --- a/test/OAuth2AdapterTest.php +++ b/test/OAuth2AdapterTest.php @@ -152,7 +152,7 @@ public function testUnauthorizedResponseProducesAResponseWithAWwwAuthenticateHea $request = $this->prophesize(ServerRequestInterface::class)->reveal(); $this->response - ->withHeader('WWW-Authenticate', 'Bearer token-example') + ->withHeader('WWW-Authenticate', 'Bearer realm="OAuth2 token"') ->will([$this->response, 'reveal']); $this->response ->withStatus(401)