PHPackages                             khoelck/phpazureauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. khoelck/phpazureauth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

khoelck/phpazureauth
====================

A library to generate Azure tokens for consuming services, using ROPC authentication method via PHP.

v1.6(2y ago)0441MITPHPPHP &gt;=7.4.11

Since Jul 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/khoelck0315/PhpAzureAuth)[ Packagist](https://packagist.org/packages/khoelck/phpazureauth)[ RSS](/packages/khoelck-phpazureauth/feed)WikiDiscussions main Synced today

READMEChangelog (3)DependenciesVersions (8)Used By (1)

PhpAzureAuth
============

[](#phpazureauth)

PhpAzureAuth is a very simple PHP library to generate Azure tokens for consuming services, specifically using ROPC authentication method via PHP. More on that from Microsoft [here.](https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc)

It is a dependency package of the [PhpPowerBI](https://github.com/khoelck0315/PhpPowerBI/tree/main) package.

Installation
============

[](#installation)

The recommended way to install is via composer

### Composer install

[](#composer-install)

```
composer require khoelck/phpazureauth

```

[PhpAzureAuth on Packagist](https://packagist.org/packages/khoelck/phpazureauth#dev-main)

### Manual install

[](#manual-install)

Copy the contents of the src folder to your include\_path, and include the libraries in your authentication script as below:

```
require "include_path/AzureAuth/Scope.php";
require "include_path/AzureAuth/AzureAuth.php";
use Khoelck\PhpAzureAuth\AzureAuth;
use Khoelck\PhpAzureAuth\Scope;

```

Initial Configuration
=====================

[](#initial-configuration)

Before using this in your code, navigate to the install folder (vendor/khoelck/phpazureauth/src for composer installs) and copy the AzureConfig.php file to your include\_path.

The following values will need to be configured for your app:

- Azure Client ID
- Azure Client Secret
- Azure OAuth 2.0 token auth URL
- Azure Tenant ID

Because this project relies on the config file, be sure to also include it on any page AzureAuth is used in addition to your composer autoload.

```
require "include_path/AzureConfig.php";

```

Use
===

[](#use)

This package is primarily designed to be used inside of your app's authentication script. Used within this script, the username and password will be able to be passed through to the AzureAuth constructor, then used to obtain the token. Please see Example.php for more information.

Related packages
================

[](#related-packages)

While this can certainly be used on it's own in your project, it's designed to use with the downstream project PhpPowerBI.

[PhpPowerBI](https://github.com/khoelck0315/PhpPowerBI/tree/main)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Recently: every ~17 days

Total

7

Last Release

1002d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50631072?v=4)[Kevin Hoelck](/maintainers/khoelck0315)[@khoelck0315](https://github.com/khoelck0315)

---

Top Contributors

[![khoelck0315](https://avatars.githubusercontent.com/u/50631072?v=4)](https://github.com/khoelck0315 "khoelck0315 (15 commits)")[![kevinhoelck0929](https://avatars.githubusercontent.com/u/118191489?v=4)](https://github.com/kevinhoelck0929 "kevinhoelck0929 (6 commits)")

### Embed Badge

![Health badge](/badges/khoelck-phpazureauth/health.svg)

```
[![Health](https://phpackages.com/badges/khoelck-phpazureauth/health.svg)](https://phpackages.com/packages/khoelck-phpazureauth)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
