php-connect-rest-sample icon indicating copy to clipboard operation
php-connect-rest-sample copied to clipboard

Unquoted array indexes in oauth.php

Open ghost opened this issue 8 years ago • 4 comments

in oauth.php

$provider = new GenericProvider([ 'clientId' => Constants::CLIENT_ID, 'clientSecret' => Constants::CLIENT_SECRET, 'redirectUri' => Constants::REDIRECT_URI, 'urlAuthorize' => Constants::AUTHORITY_URL . Constants::AUTHORIZE_ENDPOINT, 'urlAccessToken' => Constants::AUTHORITY_URL . Constants::TOKEN_ENDPOINT, 'urlResourceOwnerDetails' => '', 'scopes' => Constants::SCOPES ]);

note how the array indexes need to be quoted. After installing the sample, quotes around clientId, clientSecret, etc... are missing

Same here: // Get an access token using the authorization code grant $accessToken = $provider->getAccessToken('authorization_code', [ 'code' => $_GET['code'] ]);

Quotes around index 'code' are missing.

ghost avatar Apr 28 '18 13:04 ghost

Not sure I'm following. The quotes are there in the source files, are you saying they disappear? I just cloned it to my machine and opened it with VS Code:

image

jasonjoh avatar May 02 '18 18:05 jasonjoh

I followed a quickstart for PHP here https://developer.microsoft.com/en-us/graph/quick-start, logged in to my Microsorft account and downloaded the REST sample.

REST sample zip in annexe.

The oauth.php file is in the app folder. That particular file is missing the mentioned quotes.

Hope this helps. php-connect-rest-sample.zip

ghost avatar May 02 '18 19:05 ghost

Oh ok, I see. I reproduce it going through the QS too. Our quick start app either has a bad copy or is doing something to the file before delivering it to you. I'll investigate. Thanks for reporting this!

jasonjoh avatar May 03 '18 13:05 jasonjoh

@FirstWarden thanks for reporting this. The copy we had on our download server for the quick-start did indeed have a bad copy of the file. We've uploaded a new copy so this should be fixed.

jasonjoh avatar May 14 '18 18:05 jasonjoh