Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 082cac8

Browse files
author
Dave Rochwerger
committed
minor copy changes to 2 error messages
1 parent dbc042c commit 082cac8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/OAuth2.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public function verifyAccessToken($token_param, $scope = NULL) {
432432

433433
// Check we have a well formed token
434434
if (!isset($token["expires"]) || !isset($token["client_id"]))
435-
throw new OAuth2AuthenticateException(self::HTTP_UNAUTHORIZED, $tokenType, $realm, self::ERROR_INVALID_GRANT, 'Malformed token (missing expires or client_id)', $scope);
435+
throw new OAuth2AuthenticateException(self::HTTP_UNAUTHORIZED, $tokenType, $realm, self::ERROR_INVALID_GRANT, 'Malformed token (missing "expires" or "client_id")', $scope);
436436

437437
// Check token expiration (expires is a mandatory paramter)
438438
if (isset($token["expires"]) && time() > $token["expires"])
@@ -488,10 +488,10 @@ public function getBearerToken() {
488488
throw new OAuth2AuthenticateException(self::HTTP_BAD_REQUEST, $tokenType, $realm, self::ERROR_INVALID_REQUEST, 'Only one method may be used to authenticate at a time (Auth header, GET or POST).');
489489
}
490490
elseif ($methodsUsed == 0) {
491-
throw new OAuth2AuthenticateException(self::HTTP_BAD_REQUEST, $tokenType, $realm, self::ERROR_INVALID_REQUEST, 'The bearer token was not found.');
491+
throw new OAuth2AuthenticateException(self::HTTP_BAD_REQUEST, $tokenType, $realm, self::ERROR_INVALID_REQUEST, 'The access token was not found.');
492492
}
493493

494-
// HEADER: Get the bearer token from the header
494+
// HEADER: Get the access token from the header
495495
if (!empty($headers)) {
496496
if (!preg_match('/'.self::TOKEN_BEARER_HEADER_NAME.'\s(\S+)/', $headers, $matches)) {
497497
throw new OAuth2AuthenticateException(self::HTTP_BAD_REQUEST, $tokenType, $realm, self::ERROR_INVALID_REQUEST, 'Malformed auth header');

0 commit comments

Comments
 (0)