Closed ivannpaz closed 11 years ago
Update on this:
I manage to get it working by modifying the SilexProvider (I forgot to mention before I was using it from your own Silex provider) by setting the verifyPeer
to false...
$app['microsoft_oauth.access_token_provider.browser.client'] = $app->share(function() {
$fileGetContents = new FileGetContents();
$fileGetContents->setVerifyPeer(false);
return $fileGetContents;
});
The extra implications this might have right now escape my mind, but would it be ok to have some params (such as this) available during the service instantiation?
Thanks for submitting this issue. When I ran the functional unit test locally (with PHP 5.4 and PHPUnit 3.7.21), I had the same problem. The solution is not to disable peer verification (which is not really good for security reasons).
The solution (at least in my case) was to use a different client for the Buzz browser, so instead of FileGetContents
try Curl
:
use Buzz\Client\
$app['microsoft_oauth.access_token_provider.browser.client'] = $app->share(function() {
return new Curl();
});
You don't really need to modify the file containing the service provider itself, you can add this code after you have instantiated your application and registered the service provider.
Within a few days I will push a solution for the problem. I think the best solution would be to add a configuration flag for the type of Buzz browser client developers would want to use.
Strange though that the error is "Request method not allowed"!
Hi @matthiasnoback thanks for the fast reply!
I did the "patching" on a forked version of your provider to get it going fast as I wanted to see how the prototype of my app would do. Needless to say I didnt like my solution at all :) I will try your suggestion in a while!
About the error, at first I though it had something to do with the request being done via GET instead of POST... turns out it was a different thing, but with the server error message of another... maybe too generic error...
Hi @ivannpaz, you're welcome. In fact, you are the first to submit any serious issue to an open source project that I maintain, so it only seemed logical to attend to it very quickly ;)
HI @matthiasnoback, I will close this issue then, as it was mainly related to the configuration passed on the SilexProvider and not on this package as such. Again, thanks for your support!
@ivannpaz I've tagged the older versions as 0.1.0. Then I changed the default browser client from FileGetContents to Curl and push a new version, 0.2.0 for it. So, everything should be fine again after you run composer update.
@matthiasnoback million thanks for tagging the releases!
@ivannpaz It was a good reason to finally do this :)
While to trying to get the accessTokens the call fails. I managed to somehow pinpoint it to this particular error "ACS90007: Request method not allowed":