-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
Description
Issue / Motivation:
"laravel/socialite": "^5.5"
"socialiteproviders/trello": "^4.1"
As specified in the documentation, you can override the config like this:
$config = new \SocialiteProviders\Manager\Config($clientId, $clientSecret, $redirectUrl, $additionalProviderConfig);
return Socialite::driver('trello')->setConfig($config)->redirect();
Sadly setConfig
specified in https://github.com/SocialiteProviders/Manager/blob/master/src/OAuth1/AbstractProvider.php#L149 does only modify the config
object, but not the clientCredentials
(League\OAuth1\Client\Credentials\ClientCredentialsInterface) inside the server
(League\OAuth1\Client\Server\Server)
Expected behavior:
Calling setConfig
changes the config of the provider that is later on used by the redirect
call
Actual behavior:
Calling setConfig
leaves the values inside the OAuth1 Server instance (which seem to be the values that are actually used by
the redirect call) untouched
Steps to reproduce the behavior:
- install
socialiteproviders/trello
- try to assign a new config with different redirect uri for example
- redirect call still uses the values from config.php
Proposed solution:
Pseudocode:
#SocialiteProviders\Manager\OAuth1\AbstractProvider
public function setConfig(Config $config){
$this->config = $this->server->setConfig($config);
if($this->server instanceof League\OAuth1\Client\Server\Server){
$credentials = $this->server->getClientCredentials();
$credentials->setIdentifier($config->get()["client_id"]);
$credentials->setSecret($config->get()["client_secret"]);
$credentials->setCallbackUri($config->get()["redirect"]);
}
return $this;
}