PHPackages                             jincor/auth-php-client - 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. jincor/auth-php-client

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

jincor/auth-php-client
======================

A PHP library which encapsulates interaction with Jincor Auth

v0.1.0(8y ago)42652[1 PRs](https://github.com/JincorTech/auth-php-client/pulls)MITPHPPHP &gt;=7

Since Oct 3Pushed 8y ago3 watchersCompare

[ Source](https://github.com/JincorTech/auth-php-client)[ Packagist](https://packagist.org/packages/jincor/auth-php-client)[ RSS](/packages/jincor-auth-php-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (5)Used By (0)

Auth client
===========

[](#auth-client)

[![](https://camo.githubusercontent.com/b85968eaf231fd747ed6056c410076f6928a77e8d4d2a3231e138631a26d2823/68747470733a2f2f7472617669732d63692e6f72672f4a696e636f72546563682f617574682d7068702d636c69656e742e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/b85968eaf231fd747ed6056c410076f6928a77e8d4d2a3231e138631a26d2823/68747470733a2f2f7472617669732d63692e6f72672f4a696e636f72546563682f617574682d7068702d636c69656e742e7376673f6272616e63683d6d6173746572)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9d253c25f357982dd5ff667f04a1376ecc328b5a8d4e84624d1f242e81804dc4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4a696e636f72546563682f617574682d7068702d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/JincorTech/auth-php-client/?branch=master)[![](https://camo.githubusercontent.com/fae9fa5a30b9a34007e9ba7a8427d2adfa804704d29a3bc6be3cde1b089c35b3/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130343531313937342f736869656c64)](https://camo.githubusercontent.com/fae9fa5a30b9a34007e9ba7a8427d2adfa804704d29a3bc6be3cde1b089c35b3/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130343531313937342f736869656c64)
===========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#)

This is a client library which encapsulates interaction with [Jincor Auth](https://github.com/JincorTech/backend-auth). With its help you can:

1. Register users and tenants.
2. Get tokens for users and tenants after authorization.
3. Perform verification of tokens for users and tenants.
4. Deactivate tokens for users and tenants.
5. Remove users.

The user can be attached to several tenants through the field `tenant`. It is filled from the tenant's token in the Jincor Auth service.

Usage
-----

[](#usage)

### Initialize Auth client

[](#initialize-auth-client)

To interact with the HTTP protocol use [Guzzle](https://github.com/guzzle/guzzle). Headers `Accept: application/json` and `Content-Type: application/json` are mandatory.

```
$authClient = new AuthClient(new Client([
    'base_uri' => 'auth:3000',
    'headers' => [
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ]
]));
```

### Work with Tenant

[](#work-with-tenant)

```
$tenant = $authClient->registerTenant('tenant@example.com', 'Passwpord');
echo $tenant->getId();
// 'af8b13ea-02a9-4e73-b8d9-58c8215757b9'
$tenantToken = $authClient->loginTenant('tenant@example.com', 'Passwpord');
$result = $authClient->verifyTenantToken($tenantToken);
echo $result->getAud();
// 'jincor.com'
$authClient->logoutTenant($tenantToken);
```

### Work with User

[](#work-with-user)

To work with users you need a tenant token. Field `scope` is optional.

```
$userData = [
    'email' => 'user@example.com',
    'password' => 'Password1',
    'login' => 'emp_dev',
    'sub' => '123',
    'scope' => [
        'admin',
        'settings' => 'setting',
    ]
];
$user = $authClient->createUser($userData, $tenantToken);
echo $user->getId();
// '55096b7d-0f14-446a-b50d-ee6bc8431e39'

$userData = [
    'login' => 'emp_dev',
    'password' => 'Password1',
    'deviceId' => '123',
];
$userToken = $authClient->loginUser($userData, $tenantToken);
$result = $authClient->verifyUserToken($userToken, $tenantToken);
$authClient->logoutUser($userToken, $tenantToken);

$authClient->deleteUser($userData['login'], $tenantToken);
```

More details can be received in the tests.

### Project setup

[](#project-setup)

1. Clone the repo
2. `cd /path/to/repo`
3. `docker-compose build` - build development containers
4. `docker-compose up -d` - run container

#### Local testing

[](#local-testing)

To run all tests just type `docker-compose exec workspace ./vendor/bin/codecept run`

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.3% 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

Unknown

Total

1

Last Release

3193d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/28821095?v=4)[Jincor](/maintainers/Jincor)[@Jincor](https://github.com/Jincor)

---

Top Contributors

[![hlogeon](https://avatars.githubusercontent.com/u/3944669?v=4)](https://github.com/hlogeon "hlogeon (18 commits)")[![Aleserche](https://avatars.githubusercontent.com/u/2920837?v=4)](https://github.com/Aleserche "Aleserche (5 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jincor-auth-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/jincor-auth-php-client/health.svg)](https://phpackages.com/packages/jincor-auth-php-client)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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