Open msutyak opened 11 years ago
Had the same issue, I'm using PHP 5.4.7 and trying to connect to google.
This question from stackoverflow is probably the answer? http://stackoverflow.com/questions/17332530/laravel-oauth2-issue-in-laravel-4
However after I fixed the problem of "OAuth2\Token\Token_Access", there's a new error pointing to line 70 of Provider/Google.php:
'nickname' => strtolower(Laravel\Str::slug($user['name'], '_')),
Where it says "Class 'OAuth2\Provider\Laravel\Str' not found"
Did you manage to solve the Google error? Coz I got to this point too. Thanks
Oh, I just had to comment out that line and it worked just fine. Thanks
I am using the laravel-oauth2 package for Laravel 4 to set up a Facebook login. I am using the package seen here: https://github.com/madewithlove/laravel-oauth2 (which is based on your repository here).
When running the page that controls the login, the public/oauth/facebook, the Facebook prompt comes up fine, but when I click "accept", the page spits out the following error:
ErrorException Argument 1 passed to OAuth2\Provider\Facebook::get_user_info() must be an instance of OAuth2\Token\Token_Access, instance of OAuth2\Token_Access given, called in /Applications/MAMP/htdocs/crowdsets/laravel-master/app/controllers/Oauth2Controller.php on line 36 and defined It is pointing to /vendor/taylorotwell/laravel-oauth2/src/OAuth2/Provider/Facebook.php: 26
The get_user_info() function in Facebook.php looks like this:
public function get_user_info(Token_Access $token) { $url = 'https://graph.facebook.com/me?'.http_build_query(array( 'access_token' => $token->access_token, ));
My Oauth2Controller.php file looks like this:
<?php
class Oauth2Controller extends BaseController {
}
I am not sure why it is given me this error, as I followed the documentation and tutorials. Thank you for your help with solving this issue.