Skip to content

Commit

Permalink
Fixed isValidScope method to actually check for valid scopes :|
Browse files Browse the repository at this point in the history
  • Loading branch information
PeeHaa committed Nov 10, 2013
1 parent 92a8f40 commit 8a54c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OAuth/OAuth2/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function isValidScope($scope)
{
$reflectionClass = new \ReflectionClass(get_class($this));

return in_array($scope, $reflectionClass->getConstants());
return in_array($scope, $reflectionClass->getConstants(), true);
}

/**
Expand Down

5 comments on commit 8a54c0d

@jartaud
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't get Facebook working after this change dude. Scope email is not valid for service OAuth\OAuth2\Service\Facebook . I'm using https://github.com/artdarek/oauth-4-laravel

@PeeHaa
Copy link
Collaborator Author

@PeeHaa PeeHaa commented on 8a54c0d Nov 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the facebook scopes to the service?

@PeeHaa
Copy link
Collaborator Author

@PeeHaa PeeHaa commented on 8a54c0d Nov 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into the missing scopes.

I will also open up an issue on the external lib to add a composer directive based on releases instead of dev-master.

@PeeHaa
Copy link
Collaborator Author

@PeeHaa PeeHaa commented on 8a54c0d Nov 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent a PR to the laraval lib maintainer.

@jartaud
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your response sir. Here is my conf.:

'Facebook' => [
            'client_id'     => '--------',
            'client_secret' => '------',
            'scope'         => ['email'],
        ],
        'Google' => [
           "client_id"      => "-----",
           "client_secret"  => "------",
           'scope' => [
                    'https://www.googleapis.com/auth/userinfo.email',
                    'https://www.googleapis.com/auth/userinfo.profile',
           ]
        ],

No problem with google.

I'll check as soon as I get home.

Please sign in to comment.