-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAccessTokenProvider.php
40 lines (35 loc) · 1.29 KB
/
AccessTokenProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* Licensed under the MIT License. See License in the project root
* for license information.
*/
namespace Microsoft\Kiota\Abstractions\Authentication;
use Microsoft\Kiota\Abstraction\Promise\Promise;
/**
* Interface AccessTokenProvider
*
* Defines a contract for obtaining access tokens for a given url
*
* @package Microsoft\Kiota\Abstractions\Authentication
* @copyright 2022 Microsoft Corporation
* @license https://opensource.org/licenses/MIT MIT License
* @link https://developer.microsoft.com/graph
*/
interface AccessTokenProvider
{
/**
* Method called by {@link BaseBearerTokenAuthenticationProvider} to get the access token
* Returns a Promise that is fulfilled with the access token string
*
* @param string $url the target URI to get an access token for
* @param array<string, mixed> $additionalAuthenticationContext
* @return Promise<string|null>
*/
public function getAuthorizationTokenAsync(string $url, array $additionalAuthenticationContext = []): Promise;
/**
* Returns the {@link AllowedHostsValidator} instance used by the AccessTokenProvider
* @return AllowedHostsValidator
*/
public function getAllowedHostsValidator(): AllowedHostsValidator;
}