Download the PHP package rwandabuild/murugo_api_auth without Composer
On this page you can find all versions of the php package rwandabuild/murugo_api_auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rwandabuild/murugo_api_auth
More information about rwandabuild/murugo_api_auth
Files in rwandabuild/murugo_api_auth
Package murugo_api_auth
Short Description Package that will use Murugo auth to all 3rd party laravel projects with only API structure
License MIT
Informations about the package murugo_api_auth
Laravel API Authentication with MurugoCloudCore Package
Package that will be used for Murugo auth to all 3rd party laravel projects with only API structure
Follow the following steps to get started:
1. Install package by running the following command
2. Include the following variables in config services file
3. Dont forget to publish your migration by running the following command, when you want to upgrade
4. Use the following migration
5. Add method to redirect user to murugo
6. Add a callback method to be used after the redirection
7. Package also comes with this following method
8. Add relationship between User and Murugo User models
-
Add a Trait built in the package already that makes relationship between User model and Murugo user model
-
To access the murugo user when you already have user model like the following:
- When you have a murugo user model and you need to the related user, you can do it in the following way:
NOTES: By default package is using App\User model or App\Models|user for making relationship between your user and murugo user model
9. At this step this is how you refresh tokens
First you should know that the Murugo user model keeps the access_token
refresh_token
and the token_expires_at
, now in case you may need to refresh the token of an existing, just do it in the following way:
By Default package will add the following api routes in your laravel project
- api/murugo-auth >>> This route will be used to get response sent from murugo and save in your laravel project database
- api/authenticate-user >>>This route will authenticate user by checking uuid of user and by checking if token is still valid and if true return user object
-
api/logout >>> This route will logout user on murugo server
Follow RwandaBuild bellow and contact us
- Rwanda Build Website
- Rwanda Build On Twitter