Last active
July 24, 2018 12:44
-
-
Save mfal/4ab3c33f9e5f744e268fe13344efa120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mittwald\SpacesAuth\OAuth2; | |
use Mw\Spaces\OAuth2\EnvironmentOptions; | |
class ShopwareOptions extends EnvironmentOptions | |
{ | |
public function getClientID() | |
{ | |
return "spaces.de/oauth/cms/shopware/" . $this->getSpaceID(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mittwald\SpacesAuth\OAuth2; | |
use Mw\Spaces\OAuth2\Options; | |
class TYPO3Options implements Options | |
{ | |
private $signupURL; | |
private $allowSupportLogin; | |
private $fallback; | |
public function __construct(array $extensionConfiguration, Options $fallback) | |
{ | |
$this->fallback = $fallback; | |
$this->allowSupportLogin = $fallback->isSupportLoginAllowed(); | |
$this->signupURL = $fallback->getSignupBaseURI(); | |
if (isset($extensionConfiguration["allowSupport"]) && $extensionConfiguration["allowSupport"] !== "") { | |
$this->allowSupportLogin = (bool)$extensionConfiguration["allowSupport"]; | |
} | |
if (isset($extensionConfiguration["oauth2Server"]["value"]) && $extensionConfiguration["oauth2Server"]["value"] !== "") { | |
$this->signupURL = $extensionConfiguration["oauth2Server"]["value"]; | |
} | |
} | |
public function getSignupBaseURI() | |
{ | |
return $this->signupURL; | |
} | |
public function getSpaceID() | |
{ | |
return $this->fallback->getSpaceID(); | |
} | |
public function getClientID() | |
{ | |
return "spaces.de/oauth/cms/typo3/" . $this->getSpaceID(); | |
} | |
public function isSupportLoginAllowed() | |
{ | |
return $this->allowSupportLogin; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Siehe https://github.com/mittwald/spaces-auth#usage.
Diese Options-Implementierung erzeugt eine korrekte Client-ID für den OAuth-Request.