Merge branch 'master' of github.com:thephpleague/oauth2-server into fix-pkce-implementation

# Conflicts:
#	tests/Grant/AuthCodeGrantTest.php
This commit is contained in:
Erick Torres
2018-02-05 15:32:15 -05:00
9 changed files with 48 additions and 8 deletions

View File

@@ -47,8 +47,12 @@ class AuthCodeGrantTest extends TestCase
public function setUp()
{
$this->cryptStub = new CryptTraitStub;
$this->codeVerifier = rtrim(strtr(base64_encode(random_bytes(32)), '+/', '-_'), '=');
$this->codeChallenge = hash('sha256', strtr(rtrim(base64_encode($this->codeVerifier), '='), '+/', '-_'));
// [RFC 7636] Appendix B. Example for the S256 code_challenge_method
// $this->codeVerifier = 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk';
$this->codeVerifier = strtr(rtrim(base64_encode(random_bytes(32)), '='), '+/', '-_');
// $this->codeChallenge = 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM';
$this->codeChallenge = strtr(rtrim(base64_encode(hash('sha256', $this->codeVerifier, true)), '='), '+/', '-_');
}
public function testGetIdentifier()