You are here

protected function AuthCodeFunctionalTest::postGrantedCodeWithScopes in Simple OAuth (OAuth2) & OpenID Connect 8.3

Posts the code and requests access to the scopes.

Parameters

string $code: The granted code.

string $scopes: The list of scopes to request access to.

Return value

\Psr\Http\Message\ResponseInterface The response.

3 calls to AuthCodeFunctionalTest::postGrantedCodeWithScopes()
AuthCodeFunctionalTest::testAuthCodeGrant in simple_oauth_extras/tests/src/Functional/AuthCodeFunctionalTest.php
Test the valid AuthCode grant.
AuthCodeFunctionalTest::testNon3rdPartyClientAuthCodeGrant in simple_oauth_extras/tests/src/Functional/AuthCodeFunctionalTest.php
Test the valid AuthCode grant if the client is non 3rd party.
AuthCodeFunctionalTest::testRememberClient in simple_oauth_extras/tests/src/Functional/AuthCodeFunctionalTest.php
Tests the remember client functionality.

File

simple_oauth_extras/tests/src/Functional/AuthCodeFunctionalTest.php, line 268

Class

AuthCodeFunctionalTest
@group simple_oauth_extras

Namespace

Drupal\Tests\simple_oauth_extras\Functional

Code

protected function postGrantedCodeWithScopes($code, $scopes) {
  $valid_payload = [
    'grant_type' => 'authorization_code',
    'client_id' => $this->client
      ->uuid(),
    'client_secret' => $this->clientSecret,
    'code' => $code,
    'scope' => $scopes,
    'redirect_uri' => $this->redirectUri,
  ];
  return $this
    ->post($this->url, $valid_payload);
}