Download the PHP package jeremy379/laravel-openid-connect without Composer
On this page you can find all versions of the php package jeremy379/laravel-openid-connect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeremy379/laravel-openid-connect
More information about jeremy379/laravel-openid-connect
Files in jeremy379/laravel-openid-connect
Package laravel-openid-connect
Short Description OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.
License MIT
Homepage https://github.com/jeremy379/laravel-openid-connect
Informations about the package laravel-openid-connect
OpenID Connect for Laravel
OpenID Connect support to the PHP League's OAuth2 Server.
This is a fork of ronvanderheijden/openid-connect.
It's made to support only Laravel and Laravel Passport.
Requirements
- Requires PHP version
^8.2
. - lcobucci/jwt version
^4.0
. - league/oauth2-server
^8.2
. - Laravel 10 or Laravel 11
- Laravel Passport installed and configured
Installation
Now when calling the oauth/authorize
endpoint, provide the openid
scope to get an id_token
.
Provide more scopes (e.g. openid profile email
) to receive additional claims in the id_token
.
The id_token will be returned after the call to the oauth/token
endpoint.
Configuration
1.) Add the scope in your AuthServiceProvider in boot() method.
`
You may want to combine existing scope and oauth implementation with the open ID connect.
`
2.) create an entity
Create an entity class in app/Entities/
named IdentityEntity
or UserEntity
. This entity is used to collect the claims.
You can customize the entity setup by using another IdentityRepository, this is customizable in the config file.
The id token is a JWT and the client should verify the signature.
Here is an example to verify the signature with lcobucci/jwt
Publishing the config
In case you want to change the default scopes, add custom claim sets or change the repositories, you can publish the openid config using:
Using nonce
When nonce
is required, you need to pass it as a query parameter to passport.authorizations.approve
during authorization step.
Example based on default Passport's authorize.blade.php
:
Optional Configuration
You can add any JWT Token Headers that you want to the token_headers
array in your openid
configuration file.
This can be useful to define things like the kid
(Key ID). The kid
can be any string as long as it can uniquely identify the key you want to use in your JWKS. This can be useful when changing or rolling keys.
Example:
Additionally, you can configure the JWKS url and some settings for discovery in the config file.
_Note: If you define a kid
header, it will be added to the JWK returned at the jwksurl (if jwks
is enabled in the configuration).
Support
You can fill an issue in the github section dedicated for that. I'll try to maintain this fork.
License
OpenID Connect is open source and licensed under the MIT licence.
All versions of laravel-openid-connect with dependencies
lcobucci/jwt Version ^4.0|^4.3|^5.0
league/oauth2-server Version ^8.2.0
laravel/passport Version ^11.0|^12.0
laravel/framework Version ^10.0|^11.0
ext-openssl Version *