Download the PHP package univicosa/laravel-openid-client without Composer
On this page you can find all versions of the php package univicosa/laravel-openid-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download univicosa/laravel-openid-client
More information about univicosa/laravel-openid-client
Files in univicosa/laravel-openid-client
Package laravel-openid-client
Short Description OpenId client for the Univiçosa authenticated projects.
License MIT
Informations about the package laravel-openid-client
Univiçosa Laravel OpenId Client
univicosa/laravel-openid-client
is a Laravel package which created to integrate the Oauth server to ours Laravel project's that requires authentication.
Install
Installation using composer:
For Laravel versions < 5.5 add the service provider in config/app.php
:
To personalize the config, publish the package's configuration file by running:
The file config/openid.php
will be generated.
Oauth public key
Your system need the oauth public key
to connect and communicate with the Oauth Server.So you need to copy the public key file to storage
folder of your project.
Redirecting to Login
In the file app\Exceptions\Handler.php
find or overwrite the unauthenticated
method and change the redirect route to:
.env File
Set a variable called SESSION_LIFETIME
in the .env
file and define it to the time in minutes you want to keep the logged session. The max time of the Oauth Server keeps the session is 240 minutes (4 hours).
Change Kernel.php
In file *app/Http/Kernel.php** change the attribute $routeMiddleware
For change the Guard
change the file config\auth.php
to:
Facades
The client methods are available under the facade \OpenId.
The authentication methods like the verifier \Auth::check()
are available under the Facade \Illuminate\Support\Facades\Auth;
The facade \Oauth2 provides all helpers needed to get and post data from the Oauth Server.
\Ouath2 methods available
View components
@openidComponents
:
For load the user's logged menu, the fast access with the users permissions and render the Login Button in case you have not authenticated page, just call the Blade directive under your header component.
@login('route.name')
:
The login directive will call the route you pass or return the oauth path formated with the continue parameter to the required route.
Redirecting routes
The dynamic route from Oauth system can redirect the user back to the source using the ?continue
url parameter.
The following example will be redirect back to the source after the user executes the actions needed in the Oauth Service page:
All versions of laravel-openid-client with dependencies
guzzlehttp/guzzle Version ^6.3
laravel/framework Version ^5.4
lcobucci/jwt Version ^3.2