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 1mo ago

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

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

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

956d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8dc829878de4f373e9a46dfd893f7776ba9e1d7495f53aab8cfa29d9c50a326c?d=identicon)[khoelck0315](/maintainers/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

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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