OIDC Discovery
PHP implementation of https://openid.net/specs/openid-connect-core-1_0.html
Install
Via Composer
$ composer require digitalcz/openid-connect
Usage
$discoveryUri = 'https://example.com/.well-known/openid-configuration';
$clientMetadata = new ClientMetadata('clientid', 'clientsecret', 'https://example.com/callback');
$client = ClientFactory::create($discoveryUri, $clientMetadata);
$authorizationParams = new AuthorizationParams([
'scope' => 'openid profile',
'state' => 'foo',
'nonce' => 'bar',
]);
echo $client->getAuthorizationUrl($authorizationParams);
// https://example.com/authorize?
// scope=openid%20profile
// &state=foo
// &nonce=bar
// &response_type=code
// &redirect_uri=https%3A%2F%2Fexample.com%2Fcallback
// &client_id=clientid
See examples for more
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer csfix # fix codestyle
$ composer checks # run all checks
# or separately
$ composer tests # run phpunit
$ composer phpstan # run phpstan
$ composer cs # run codesniffer
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.