Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set some params in list of options in constructor #133

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

vyskocilpavel
Copy link
Contributor

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.

* List of added options: 'scopes', 'defaultEndPointVersion'
@hajekj
Copy link
Member

hajekj commented Jan 11, 2021

Looks pretty good to me, thanks for the PR! Will release this as v2.0.1 since it is not a breaking change.

@hajekj hajekj merged commit 2649422 into TheNetworg:master Jan 11, 2021
@hajekj
Copy link
Member

hajekj commented Jan 11, 2021

@decomplexity
Copy link

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;

@hajekj
Copy link
Member

hajekj commented Jan 11, 2021

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.

@decomplexity
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants