mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 13:09:44 +05:30
Merge pull request #1009 from iansltx/skip-s256-if-not-installed
Skip SHA256 verifier if system doesn't support sha256
This commit is contained in:
commit
1bbcb57d63
@ -58,14 +58,13 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
|
|||||||
$this->authCodeTTL = $authCodeTTL;
|
$this->authCodeTTL = $authCodeTTL;
|
||||||
$this->refreshTokenTTL = new DateInterval('P1M');
|
$this->refreshTokenTTL = new DateInterval('P1M');
|
||||||
|
|
||||||
// SHOULD ONLY DO THIS IS SHA256 is supported
|
if (in_array('sha256', hash_algos(), true)) {
|
||||||
$s256Verifier = new S256Verifier();
|
$s256Verifier = new S256Verifier();
|
||||||
$plainVerifier = new PlainVerifier();
|
$this->codeChallengeVerifiers[$s256Verifier->getMethod()] = $s256Verifier;
|
||||||
|
}
|
||||||
|
|
||||||
$this->codeChallengeVerifiers = [
|
$plainVerifier = new PlainVerifier();
|
||||||
$s256Verifier->getMethod() => $s256Verifier,
|
$this->codeChallengeVerifiers[$plainVerifier->getMethod()] = $plainVerifier;
|
||||||
$plainVerifier->getMethod() => $plainVerifier,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user