/**
* Returns whether this OAuth provider is enabled.
*/
- abstract protected function isEnabled(): bool;
+ protected function isEnabled(): bool
+ {
+ return !empty($this->getClientId()) && !empty($this->getClientSecret());
+ }
protected function mapParameters(ServerRequestInterface $request): OAuth2Success | OAuth2Failure | null
{
*/
final class FacebookAuthAction extends AbstractOauth2AuthAction
{
- #[\Override]
- protected function isEnabled(): bool
- {
- return !empty(FACEBOOK_PUBLIC_KEY) && !empty(FACEBOOK_PRIVATE_KEY);
- }
-
#[\Override]
protected function getTokenEndpoint(): string
{
return 'https://github.com/login/oauth/access_token';
}
- #[\Override]
- public function isEnabled(): bool
- {
- return !empty(GITHUB_PUBLIC_KEY) && !empty(GITHUB_PRIVATE_KEY);
- }
-
#[\Override]
protected function getClientId(): string
{
return $this->configuration;
}
- #[\Override]
- protected function isEnabled(): bool
- {
- return !empty(GOOGLE_PUBLIC_KEY) && !empty(GOOGLE_PRIVATE_KEY);
- }
-
#[\Override]
protected function getTokenEndpoint(): string
{
*/
final class TwitterAuthAction extends AbstractOauth2AuthAction
{
- #[\Override]
- protected function isEnabled(): bool
- {
- return !empty(TWITTER_PUBLIC_KEY) && !empty(TWITTER_PRIVATE_KEY);
- }
-
#[\Override]
protected function getClientId(): string
{