Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
php-versions: ['7.4', '8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4.1.7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -41,7 +41,7 @@ jobs:
code-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4.1.7
- name: Setup PHP and Xdebug for Code Coverage report
uses: shivammathur/setup-php@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4.1.7

- name: Get SDK version and set environment variable
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run-php-documentor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4.1.7
with:
ref: ${{ github.ref }}

Expand Down
9 changes: 6 additions & 3 deletions src/Authentication/GraphPhpLeagueAccessTokenProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Microsoft\Graph\Core\Authentication;


use League\OAuth2\Client\Provider\AbstractProvider;
use Microsoft\Graph\Core\NationalCloud;
use Microsoft\Kiota\Authentication\Cache\AccessTokenCache;
use Microsoft\Kiota\Authentication\Oauth\ProviderFactory;
Expand Down Expand Up @@ -39,12 +40,14 @@ class GraphPhpLeagueAccessTokenProvider extends PhpLeagueAccessTokenProvider
* @param string $nationalCloud Defaults to https://graph.microsoft.com. See
* https://learn.microsoft.com/en-us/graph/deployments
* @param AccessTokenCache|null $accessTokenCache Defaults to an in-memory cache if null
* @param AbstractProvider|null $oauthProvider Your own oauth provider if you don't want to use the default.
*/
public function __construct(
TokenRequestContext $tokenRequestContext,
array $scopes = [],
string $nationalCloud = NationalCloud::GLOBAL,
?AccessTokenCache $accessTokenCache = null
?AccessTokenCache $accessTokenCache = null,
?AbstractProvider $oauthProvider = null
)
{
$nationalCloud = empty($nationalCloud) ? NationalCloud::GLOBAL : $nationalCloud;
Expand All @@ -58,7 +61,7 @@ public function __construct(
];
$tokenBaseServiceUrl = self::NATIONAL_CLOUD_TO_AZURE_AD_ENDPOINT[$nationalCloud] ??
self::NATIONAL_CLOUD_TO_AZURE_AD_ENDPOINT[NationalCloud::GLOBAL];
$oauthProvider = ProviderFactory::create(
$oauthProvider = $oauthProvider ?? ProviderFactory::create(
$tokenRequestContext,
[],
$tokenBaseServiceUrl,
Expand All @@ -73,7 +76,7 @@ public function __construct(
* @param AccessTokenCache $accessTokenCache
* @param TokenRequestContext $tokenRequestContext
* @param array<string> $scopes
* @return GraphPhpLeagueAccessTokenProvider
* @return self
*/
public static function createWithCache(
AccessTokenCache $accessTokenCache,
Expand Down