victorap93 / azuread
Azure AD is an easy way to use Azure AD 2.0 Protocols to get authorization token
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/victorap93/azuread
Requires
- php: >=5.5
- guzzlehttp/guzzle: ^6.5
README
Azure AD is an easy way to use Azure AD 2.0 Protocols to get authorization token
Installation
The recommended way to install this is through Composer.
composer require victorap93/azuread
How to use
Get the nedded parameters:
Read this step to know how to get neded params.
Get Token by using Microsoft client secret:
require_once "./vendor/autoload.php"; use \victorap93\AzureAD; $tenantId = ""; $clientId = ""; $scope = "https://graph.microsoft.com/.default"; $clientSecret = ""; $AzureAD = new AzureAD; $azure_token = $AzureAD->getMSTokenBySecret($tenantId, $clientId, $scope, $clientSecret); echo $azure_token->access_token;
Get Token by using Miscrosoft username and password:
require_once "./vendor/autoload.php"; use \victorap93\AzureAD; $tenantId = ""; $clientId = ""; $scope = "https://graph.microsoft.com/.default"; $username = ""; $password = ""; $AzureAD = new AzureAD; $azure_token = $AzureAD->getMSTokenByCredentials($tenantId, $clientId, $scope, $username, $password); echo $azure_token->access_token;
Help and docs
License
Azure AD is made available under the MIT License (MIT). Please see License File for more information.