raegmaen / openid-connect-php
OpenID Connect client
Installs: 18 500
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 382
Open Issues: 1
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- kelvinmo/simplejwt: ^0.1.6
- phpseclib/phpseclib: 2.0.1
- psr/simple-cache: ^1.0
This package is not auto-updated.
Last update: 2025-03-30 07:41:10 UTC
README
PHP library to authenticate users against an identity provider using the OpenId Connect protocol.
Use cases implemented:
- Authentication using the Authorization Code Flow
- Refreshing access token with refresh token
Requirements
- PHP 5.6 or greater
- CURL extension
- JSON extension
Install
Composer
composer require raegmaen/openid-connect-php
License
Example:
$openIdConnectClient = OpenIdConnectFactory::create( $providerUrl, $clientId, $clientSecret, $callbackUrl ); $authenticationResult = $this->openIdConnectClient->authenticate($requestData); if ($authenticationResult instanceof UserRedirect) { // Redirect user to given Url } $claims = $authenticationResult->getIdToken()->getClaims(); $name = $claims->get('given_name');