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 today

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 31% of packages

Maintenance43

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity38

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

457d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9591792?v=4)[René Kirk](/maintainers/tykfyr)[@tykfyr](https://github.com/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.4k294.2M219](/packages/google-auth)[thenetworg/oauth2-azure

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

25310.7M83](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

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

2306.4M45](/packages/stevenmaguire-oauth2-keycloak)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5181.2M3](/packages/robsontenorio-laravel-keycloak-guard)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[rainlab/user-plugin

User plugin for October CMS

11955.0k15](/packages/rainlab-user-plugin)

PHPackages © 2026

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