Closed vyskocilpavel closed 3 years ago
Looks pretty good to me, thanks for the PR! Will release this as v2.0.1
since it is not a breaking change.
If PR'er wants to use 2.0.1 with the Microsoft Graph REST API instead of the older Azure AD Graph, note that the following changes appear needed in Azure.php 2.0.1 (vide my issue #127):
Line 35:
public $urlAPI = 'https://graph.windows.net/';
=>
public $urlAPI = 'https://graph.microsoft.com/';
Line 39:
public $API_VERSION = '1.6';
=>
public $API_VERSION = '1.0';
line 214
if (false !== strpos($this->urlAPI, 'graph.windows.net')) {
=>
if (false !== strpos($this->urlAPI, ‘graph.microsoft.com’)) {
and defaultEndPointVersion needs overriding to ENDPOINT_VERSION_2_0;
I will see if I can get this fixed. Would be great if people used https://github.com/microsoftgraph/msgraph-sdk-php instead for calling Microsoft Graph.
Tnx Jan. We already use the MSgraph SDK for some new apps. However, most of our websites use the 'Send_Oauth2' wrapper that we developed for PHPMailer. This wrapper supports the numerous ‘email’ instances typical websites need (Contact page, purchase emails, notifications from Paypal IPN and so on) with a single repository of clientID, clientSecret and refresh token, and supports both MSFT 365 and Gmail, and Basic Auth as well as Oauth2. The MSFT 365 ‘provider’ – which uses Graph V1 and V2 AUTHN/Z endpoints is your own excellent one – for which we are very grateful! - with the overrides (above).
Hi, We are using simplesamlphp module(https://github.com/cirrusidentity/simplesamlphp-module-authoauth2) with some oauth2-clients. We want to use your client for AzureAD, but we need the possibility to set scopes and defaultEndPointVersion from the 'options' field in the constructor.
This PR allows setting the 'scopes' and 'defaultEndPointVersion' from the constructor.
Thanks for the review.