PHPackages                             kemalaydin/openid-connect-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. kemalaydin/openid-connect-php

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

kemalaydin/openid-connect-php
=============================

OpenID Connect client

v0.9.7(5y ago)0689Apache-2.0PHPPHP &gt;=5.4

Since Sep 4Pushed 5y agoCompare

[ Source](https://github.com/kemalaydin/OpenID-Connect-PHP)[ Packagist](https://packagist.org/packages/kemalaydin/openid-connect-php)[ RSS](/packages/kemalaydin-openid-connect-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (20)Used By (0)

PHP OpenID Connect Basic Client
===============================

[](#php-openid-connect-basic-client)

A simple library that allows an application to authenticate a user through the basic OpenID Connect flow. This library hopes to encourage OpenID Connect use by making it simple enough for a developer with little knowledge of the OpenID Connect protocol to setup authentication.

A special thanks goes to Justin Richer and Amanda Anganes for their help and support of the protocol.

Requirements
============

[](#requirements)

1. PHP 5.4 or greater
2. CURL extension
3. JSON extension

Install
-------

[](#install)

1. Install library using composer

```
composer require jumbojett/openid-connect-php

```

2. Include composer autoloader

```
require __DIR__ . '/vendor/autoload.php';
```

Example 1: Basic Client
-----------------------

[](#example-1-basic-client)

```
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient('https://id.provider.com',
                                'ClientIDHere',
                                'ClientSecretHere');
$oidc->setCertPath('/path/to/my.cert');
$oidc->authenticate();
$name = $oidc->requestUserInfo('given_name');
```

[See openid spec for available user attributes](http://openid.net/specs/openid-connect-basic-1_0-15.html#id_res)

Example 2: Dynamic Registration
-------------------------------

[](#example-2-dynamic-registration)

```
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient("https://id.provider.com");

$oidc->register();
$client_id = $oidc->getClientID();
$client_secret = $oidc->getClientSecret();

// Be sure to add logic to store the client id and client secret
```

Example 3: Network and Security
-------------------------------

[](#example-3-network-and-security)

```
// Configure a proxy
$oidc->setHttpProxy("http://my.proxy.com:80/");

// Configure a cert
$oidc->setCertPath("/path/to/my.cert");
```

Example 4: Request Client Credentials Token
-------------------------------------------

[](#example-4-request-client-credentials-token)

```
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient('https://id.provider.com',
                                'ClientIDHere',
                                'ClientSecretHere');
$oidc->providerConfigParam(array('token_endpoint'=>'https://id.provider.com/connect/token'));
$oidc->addScope('my_scope');

// this assumes success (to validate check if the access_token property is there and a valid JWT) :
$clientCredentialsToken = $oidc->requestClientCredentialsToken()->access_token;
```

Example 5: Request Resource Owners Token (with client auth)
-----------------------------------------------------------

[](#example-5-request-resource-owners-token-with-client-auth)

```
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient('https://id.provider.com',
                                'ClientIDHere',
                                'ClientSecretHere');
$oidc->providerConfigParam(array('token_endpoint'=>'https://id.provider.com/connect/token'));
$oidc->addScope('my_scope');

//Add username and password
$oidc->addAuthParam(array('username'=>''));
$oidc->addAuthParam(array('password'=>''));

//Perform the auth and return the token (to validate check if the access_token property is there and a valid JWT) :
$token = $oidc->requestResourceOwnerToken(TRUE)->access_token;
```

Example 6: Basic client for implicit flow e.g. with Azure AD B2C (see [http://openid.net/specs/openid-connect-core-1\_0.html#ImplicitFlowAuth](http://openid.net/specs/openid-connect-core-1_0.html#ImplicitFlowAuth))
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#example-6-basic-client-for-implicit-flow-eg-with-azure-ad-b2c-see-httpopenidnetspecsopenid-connect-core-1_0htmlimplicitflowauth)

```
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient('https://id.provider.com',
                                'ClientIDHere',
                                'ClientSecretHere');
$oidc->setResponseTypes(array('id_token'));
$oidc->addScope(array('openid'));
$oidc->setAllowImplicitFlow(true);
$oidc->addAuthParam(array('response_mode' => 'form_post'));
$oidc->setCertPath('/path/to/my.cert');
$oidc->authenticate();
$sub = $oidc->getVerifiedClaims('sub');
```

Example 7: Introspection of an access token (see )
---------------------------------------------------------------------------------------

[](#example-7-introspection-of-an-access-token-see-httpstoolsietforghtmlrfc7662)

```
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient('https://id.provider.com',
                                'ClientIDHere',
                                'ClientSecretHere');
$data = $oidc->introspectToken('an.access-token.as.given');
if (!$data->active) {
    // the token is no longer usable
}
```

Development Environments
------------------------

[](#development-environments)

In some cases you may need to disable SSL security on on your development systems. Note: This is not recommended on production systems.

```
$oidc->setVerifyHost(false);
$oidc->setVerifyPeer(false);
```

### Todo

[](#todo)

- Dynamic registration does not support registration auth tokens and endpoints

Contributing
------------

[](#contributing)

- All pull requests, once merged, should be added to the changelog.md file.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.9% 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 ~104 days

Recently: every ~1 days

Total

17

Last Release

2050d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.2

0.3.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/392737891e49da1909997b5cb955adfdd4623d867a6b535eecce3c68daf95709?d=identicon)[kemalaydin](/maintainers/kemalaydin)

---

Top Contributors

[![jumbojett](https://avatars.githubusercontent.com/u/410057?v=4)](https://github.com/jumbojett "jumbojett (173 commits)")[![DeepDiver1975](https://avatars.githubusercontent.com/u/1005065?v=4)](https://github.com/DeepDiver1975 "DeepDiver1975 (15 commits)")[![rasodu](https://avatars.githubusercontent.com/u/13222196?v=4)](https://github.com/rasodu "rasodu (9 commits)")[![radenui](https://avatars.githubusercontent.com/u/9445250?v=4)](https://github.com/radenui "radenui (9 commits)")[![kenguest](https://avatars.githubusercontent.com/u/234118?v=4)](https://github.com/kenguest "kenguest (7 commits)")[![morcs](https://avatars.githubusercontent.com/u/555420?v=4)](https://github.com/morcs "morcs (6 commits)")[![baru](https://avatars.githubusercontent.com/u/688602?v=4)](https://github.com/baru "baru (5 commits)")[![guss77](https://avatars.githubusercontent.com/u/381782?v=4)](https://github.com/guss77 "guss77 (5 commits)")[![jdreed](https://avatars.githubusercontent.com/u/4193101?v=4)](https://github.com/jdreed "jdreed (5 commits)")[![corentingi](https://avatars.githubusercontent.com/u/3458976?v=4)](https://github.com/corentingi "corentingi (4 commits)")[![JuliusPC](https://avatars.githubusercontent.com/u/15018932?v=4)](https://github.com/JuliusPC "JuliusPC (4 commits)")[![kemalaydin](https://avatars.githubusercontent.com/u/5579589?v=4)](https://github.com/kemalaydin "kemalaydin (4 commits)")[![adambartholomew](https://avatars.githubusercontent.com/u/324503?v=4)](https://github.com/adambartholomew "adambartholomew (3 commits)")[![bobvandevijver](https://avatars.githubusercontent.com/u/1835343?v=4)](https://github.com/bobvandevijver "bobvandevijver (3 commits)")[![JTubex](https://avatars.githubusercontent.com/u/5894935?v=4)](https://github.com/JTubex "JTubex (3 commits)")[![lordelph](https://avatars.githubusercontent.com/u/444004?v=4)](https://github.com/lordelph "lordelph (3 commits)")[![n0nag0n](https://avatars.githubusercontent.com/u/2322095?v=4)](https://github.com/n0nag0n "n0nag0n (3 commits)")[![seth-xdam](https://avatars.githubusercontent.com/u/22687020?v=4)](https://github.com/seth-xdam "seth-xdam (3 commits)")[![stijnster](https://avatars.githubusercontent.com/u/27271?v=4)](https://github.com/stijnster "stijnster (3 commits)")[![dpesch](https://avatars.githubusercontent.com/u/318884?v=4)](https://github.com/dpesch "dpesch (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kemalaydin-openid-connect-php/health.svg)

```
[![Health](https://phpackages.com/badges/kemalaydin-openid-connect-php/health.svg)](https://phpackages.com/packages/kemalaydin-openid-connect-php)
```

###  Alternatives

[jumbojett/openid-connect-php

Bare-bones OpenID Connect client

7169.8M38](/packages/jumbojett-openid-connect-php)[azimolabs/apple-sign-in-php-sdk

Library to verify and validate Apple IdentityToken and authenticate a user with Apple ID.

92463.9k](/packages/azimolabs-apple-sign-in-php-sdk)[strobotti/php-jwk

A small PHP library to handle JWKs (Json Web Keys)

24880.8k7](/packages/strobotti-php-jwk)[clerkinc/backend-php

2755.0k](/packages/clerkinc-backend-php)[jakub-onderka/openid-connect-php

Bare-bones OpenID Connect client

1151.4k](/packages/jakub-onderka-openid-connect-php)[laranex/laravel-biometric-auth

A laravel package to provide asymmetric biometric authentication

106.0k](/packages/laranex-laravel-biometric-auth)

PHPackages © 2026

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