Download the PHP package revenuefm/ssoguard without Composer
On this page you can find all versions of the php package revenuefm/ssoguard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download revenuefm/ssoguard
More information about revenuefm/ssoguard
Files in revenuefm/ssoguard
Package ssoguard
Short Description Laravel SSO package
License MIT
Homepage https://github.com/revenuefm/ssoguard
Informations about the package ssoguard
How to use Oauth2 access token of auth server to authorize users in resource/app server?
This package is inspired by the issue founded on on the StackOverflow.
Package is aimed towards those who wants to implement the following situations
- Auth server on Laravel (central user directory, OAuth2 using laravel/passport)
- Resource servers on Laravel or Lumen (web apps, no user tables)
- Client side JS app (Nuxt, React...)
Note worth noting that the User model must exists. You just need to change the connection to the database where the Auth server is.
What is the workflow?
- Login button on Client takes to auth server, oauth2 client is authorized by user and get auth code and redirect back to client.
- Client then uses request to send data to resource server, with also providing the resource server the credentials.
- Resource server with this guard authorizes the request so you can keep your API secure.
Instalation
Via composer
After you installed the package publish the config
Open the config file and add the route to the me
object where you are fetching the user object on Auth server.
For example https://your-domain.com/api/user
.
Using the guard
Simple as is, change the API guard driver in your config auth
to:
After that you can use the standard API middleware
The user object will be available from
as standard one.
If somebody wants to grow this package and make it better, please involve.
Best!