Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AccessToken/Verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function __construct(
* accepted. By default, the id token must have been issued to this OAuth2 client.
*
* @param string $idToken the ID token in JWT format
* @param string $audience Optional. The audience to verify against JWt "aud"
* @param string $audience Optional. The audience to verify against JWT "aud"
* @return array|false the token payload, if successful
*/
public function verifyIdToken($idToken, $audience = null)
Expand Down
6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ public function authorize(ClientInterface $http = null)
$this->config['token_callback']
);
}

if ($token = $this->getAccessToken()) {
$scopes = $this->prepareScopes();
// add refresh subscriber to request a new token
Expand Down Expand Up @@ -794,10 +793,11 @@ public function revokeToken($token = null)
* @throws LogicException If no token was provided and no token was set using `setAccessToken`.
* @throws UnexpectedValueException If the token is not a valid JWT.
* @param string|null $idToken The token (id_token) that should be verified.
* @param string|null $audience Optional. The audience to verify against JWT "aud".
* @return array|false Returns the token payload as an array if the verification was
* successful, false otherwise.
*/
public function verifyIdToken($idToken = null)
public function verifyIdToken($idToken = null, string $audience = null)
{
$tokenVerifier = new Verify(
$this->getHttpClient(),
Expand All @@ -817,7 +817,7 @@ public function verifyIdToken($idToken = null)

return $tokenVerifier->verifyIdToken(
$idToken,
$this->getClientId()
$audience ?: $this->getClientId() // use the client ID when no audience is supplied
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Http/REST.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static function execute(
*/
public static function doExecute(ClientInterface $client, RequestInterface $request, $expectedClass = null)
{
// var_dump($request);exit;
try {
$httpHandler = HttpHandlerFactory::build($client);
$response = $httpHandler($request);
Expand Down