Closed sftgunner closed 4 years ago
Same issue here! Did the same as Gunner 237. Used the exact example for the readme, and just added autoload.php and entered variables of my app.
Running the script results in "PHP Fatal error: Uncaught Error: Class 'Azure' not found in C:\inetpub\site5\public\aad.php:13".
I am running IIS 10 and PHP 7.3.7.
I had the same problem. Turns out, using composer, the latest version is 1.4.2. The documentation on this github page is not compatible with this version. Solution is to use the documentation on the 1.4.2 tree: https://github.com/TheNetworg/oauth2-azure/tree/v1.4.2.
This offcourse if you decide to use the 1.4.2 version.
Hi SKLE, okay, that explains why it's not working.
But what version do we need to use for the example in the documentation then? Is there something newer than 1.4.2?
@skle I also tried using the v2.0.0.x-dev branch, to no avail; I'll try dev-master shortly to see if that makes a difference. Thanks for providing a link to the 1.4.2 documentation though, that makes a lot of sense. Will also try that.
Try changing the version in composer.json from 1.4 to 'dev-master'. Run 'composer update' after that. That did the trick for me.
Hi everyone, I am aiming to release the current master as v1.5 or v2.0 rather since it has breaking changes which you are experiencing right now. All I want to do there before the release is the cache of OIDC metadata calls.
Can confirm that using the dev-master branch fixed this issue. Many thanks to all
Apologies if this is a really obvious fix.
I tried to install and set up oauth2-azure by running
composer require thenetworg/oauth2-azure
in a new directory on my webserver, which appeared to complete successfully.However, when I copied and pasted the Authorization Code Flow sample from the README file, i get the following error:
Fatal error: Uncaught Error: Class 'Azure' not found in /Users/Gunner237/GitHub/oauth-test/index.php:11 Stack trace: #0 {main} thrown in /Users/Gunner237/GitHub/oauth-test/index.php on line 11
.index.php is identical to the code in the Authorization Code Flow sample from the README, except that I added the line
require_once __DIR__ . '/vendor/autoload.php';
at the beginning, and substituted my own client ID, secret and redirect URI for the placeholders.I've tried deleting the vendor and composer files and redownloading different branches, but to no avail.
When I tried commenting out the offending line (beginning
$provider->defaultEndPointVersion
), as the comment above seems to imply that that line is optional, I instead receive this errorFatal error: Uncaught Error: Call to undefined method TheNetworg\OAuth2\Client\Provider\Azure::getRootMicrosoftGraphUri() in /Users/Gunner237/GitHub/oauth-test/index.php:13 Stack trace: #0 {main} thrown in /Users/Gunner237/GitHub/oauth-test/index.php on line 13
Line 13 is
$baseGraphUri = $provider->getRootMicrosoftGraphUri(null);
I'm using Apache2 on MacOS 10.15.4 with PHP 7.3.11 by default, if that makes a difference. Composer is up-to-date (1.10.6).
Below is the total CLI output when trying to use composer: