HybridAuth Facebook Invalid Scope: Array (Please check lower letter case or delimiter)

291 views Asked by At

Facebook started returning this error a few days ago:

"Invalid Scope: Array (Please check lower letter case or delimiter)"

I haven't made a changes to the login functionality, or facebook app setting in a while. Any idea what's wrong with this scope, or what changed?

$config = [
        'callback' => HttpClient\Util::getCurrentUrl(),
        'providers' => [
            PROVIDER => [
                "enabled" => true,
                "keys"    => [
                "id" => "nnnnnnnnnnnnnnn",
                "secret" => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ],
                "scope"   => ['public_profile', 'email']
            ],         
        ],
    ];

The uri for the facebook error page is:

https://www.facebook.com/dialog/oauth?response_type=code&client_id=nnnnnnnnnnnnnnn&redirect_uri=https%3A%2F%2Fxxxxxxxxx.com%2Ffacebook-login.php&scope[0]=public_profile&scope[1]=email&state=HA-nnnnxnnnnxnnnnxnnnnxnnnnxnnnnxnnnx

You can try my Facebook login here: https://trailsnh.com/dashboard.php

1

There are 1 answers

0
Travis Spencer On

I know you said you fixed it by changing it to comma-separated string, and that's great. The docs about this are on the Facebook Developer site. There, they say:

scope. A comma or space separated list of Permissions to request from the person using your app.

Personally, I would change it space-separated since that's what's defined in the OAuth specification:

The value of the scope parameter is expressed as a list of space-delimited, case-sensitive strings.

If it changes again at Facebook, I would expect it to remain compliant with the spec. So, if you change it to anything, I think that's the more bulletproof option.