PHPackages                             tykfyr/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. tykfyr/openid-connect-php

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

tykfyr/openid-connect-php
=========================

A simple OpenID Connect client library for PHP

v1.0.0(1y ago)12MITPHPPHP &gt;=7.4

Since Apr 3Pushed 1y ago1 watchersCompare

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

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

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

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

A simple OpenID Connect client library for PHP that makes it easy to integrate OpenID Connect authentication into your PHP applications.

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- cURL extension
- JSON extension

Installation
------------

[](#installation)

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

Usage
-----

[](#usage)

### Basic Authentication Flow

[](#basic-authentication-flow)

```
use Tykfyr\OpenIDConnect\Client;

// Initialize the client
$oidc = new Client(
    'https://your-identity-provider.com',
    'your-client-id',
    'your-client-secret'
);

// Set the redirect URI
$oidc->setRedirectUri('https://your-app.com/callback');

// Start authentication
$oidc->authenticate();

// In your callback handler
$oidc->handleCallback();

// Get user information
$userInfo = $oidc->requestUserInfo();
$email = $oidc->requestUserInfo('email');
```

### Advanced Configuration

[](#advanced-configuration)

```
// Configure SSL verification
$oidc->setVerifyHost(false); // Disable host verification (not recommended for production)
$oidc->setVerifyPeer(false); // Disable peer verification (not recommended for production)

// Set custom certificate path
$oidc->setCertPath('/path/to/cert.pem');

// Configure proxy
$oidc->setHttpProxy('http://proxy.example.com:8080');

// Set custom scopes
$oidc->setScopes(['openid', 'profile', 'email', 'custom_scope']);
```

Features
--------

[](#features)

- Full OpenID Connect authentication flow
- Automatic discovery of provider configuration
- JWT token validation
- User info endpoint support
- Configurable SSL verification
- Proxy support
- Custom scopes support

Security Considerations
-----------------------

[](#security-considerations)

- Always use HTTPS in production
- Keep your client secret secure
- Validate the state parameter
- Verify the ID token
- Use appropriate scopes for your needs

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c90ca5ed9ef8060ed9ee0eb1d718f0a94d4dc5c3d1be99ef8295c87e1b38923?d=identicon)[tykfyr](/maintainers/tykfyr)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

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

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5161.1M3](/packages/robsontenorio-laravel-keycloak-guard)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[wp-graphql/wp-graphql-jwt-authentication

JWT Authentication for WPGraphQL

361118.4k1](/packages/wp-graphql-wp-graphql-jwt-authentication)

PHPackages © 2026

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