PHPackages                             martinjinda/keycloak-adapter-php - 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. martinjinda/keycloak-adapter-php

ActiveLibrary

martinjinda/keycloak-adapter-php
================================

Easy-to-use PHP adapter for Keycloak authentication

2.1.1(12mo ago)013MITPHPPHP &gt;= 7.2.0

Since Apr 30Pushed 12mo agoCompare

[ Source](https://github.com/martinjinda/keycloak-adapter-php)[ Packagist](https://packagist.org/packages/martinjinda/keycloak-adapter-php)[ RSS](/packages/martinjinda-keycloak-adapter-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Keycloak PHP adapter
====================

[](#keycloak-php-adapter)

[![Latest Stable Version](https://camo.githubusercontent.com/91b9281ac5d2d5e7d8ef253daf6d42cb95eb640887226dc2af6f33656ba2a7d5/68747470733a2f2f706f7365722e707567782e6f72672f6174616363616d612f6b6579636c6f616b2d616461707465722f762f737461626c65)](https://packagist.org/packages/ataccama/keycloak-adapter) [![Total Downloads](https://camo.githubusercontent.com/2e41cfbdea219d1865f1ba09441a782b95233610e35566fdb7cf72e98d59f192/68747470733a2f2f706f7365722e707567782e6f72672f6174616363616d612f6b6579636c6f616b2d616461707465722f646f776e6c6f616473)](https://packagist.org/packages/ataccama/keycloak-adapter) [![License](https://camo.githubusercontent.com/e55d22743cd4ed09578893b1ff5c497feebf55c302b845d27cb7920cd8d4fab0/68747470733a2f2f706f7365722e707567782e6f72672f6174616363616d612f6b6579636c6f616b2d616461707465722f6c6963656e7365)](https://packagist.org/packages/ataccama/keycloak-adapter) [![Monthly Downloads](https://camo.githubusercontent.com/91c429c6c3cca91f2f83fc8c33d5db2111c4c5959409d449f12d2dabe5056999/68747470733a2f2f706f7365722e707567782e6f72672f6174616363616d612f6b6579636c6f616b2d616461707465722f642f6d6f6e74686c79)](https://packagist.org/packages/ataccama/keycloak-adapter)

Install
-------

[](#install)

`composer require ataccama/keycloak-adapter`

Neon config:

```
parameters:
    keycloak:
        realmId: your_realm
        clientDd: your_client_id
        host: https://your.keycloak.com
        defaultRedirectUri: https://your.default.url
        api:
            username: your_username
            password: your_password
            clientId: your_api_client_id
            clientSecret: your_client_secret

services:
    - Ataccama\Adapters\Keycloak(%keycloak%)

```

Use
---

[](#use)

Create new class and extend class Ataccama\\Auth, then you MUST implement all missing methods with your own logic.

Login URL: `$loginUrl = $yourAuthClass->getLoginUrl()`

In code use your class like this: `$yourAuthClass->authorize($_GET['code'])`

Example (Nette Framework):

```
// waiting for authorization code from Keycloak
if ($yourAuthClass->authorize($this->getParameter('code'))) {
    $this->redirectUrl($yourAuthClass->getRedirectUri());
} else {
    if (!$yourAuthClass->isAuthorized()) {
        $this->redirectUrl($yourAuthClass->getLoginUrl());
    }
}

// check if user is logged in on every page, if not redirect him to Keycloak login page
if (!$yourAuthClass->isAuthorized()) {
    $this->redirectUrl($yourAuthClass->getLoginUrl());
}

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% 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 ~12 days

Total

2

Last Release

364d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9d763939d7ce6c86f873af173769a5d702dac57cb0536400aaef9a24bab14d2?d=identicon)[martinjinda](/maintainers/martinjinda)

---

Top Contributors

[![stolfam](https://avatars.githubusercontent.com/u/37073073?v=4)](https://github.com/stolfam "stolfam (4 commits)")[![martinjinda](https://avatars.githubusercontent.com/u/9948632?v=4)](https://github.com/martinjinda "martinjinda (2 commits)")

### Embed Badge

![Health badge](/badges/martinjinda-keycloak-adapter-php/health.svg)

```
[![Health](https://phpackages.com/badges/martinjinda-keycloak-adapter-php/health.svg)](https://phpackages.com/packages/martinjinda-keycloak-adapter-php)
```

###  Alternatives

[nette/php-generator

🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.

2.2k64.2M576](/packages/nette-php-generator)[nette/caching

⏱ Nette Caching: library with easy-to-use API and many cache backends.

43518.6M368](/packages/nette-caching)[nette/mail

📧 Nette Mail: A handy library for creating and sending emails in PHP.

5389.8M246](/packages/nette-mail)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2592.8M263](/packages/ssch-typo3-rector)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)

PHPackages © 2026

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