Download the PHP package rehankanak/guardian without Composer
On this page you can find all versions of the php package rehankanak/guardian. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rehankanak/guardian
More information about rehankanak/guardian
Files in rehankanak/guardian
Package guardian
Short Description Laravel package for verifying desktop sign-in via a mobile app
License MIT
Homepage https://github.com/zusamarehan/guardian
Informations about the package guardian
Verifying Desktop sign-in via Mobile app
This Laravel package helps your application to verify a user's sign-in on a desktop browser via a mobile app. It works by generating a set of options, to which the user responds via the mobile app. If the user responds correctly, then the sign-in is verified and can be authorized.
We have the following GuardingType in our package
- INPUT: The user inputs a code, into the mobile app.
- PRESS: The users presses a code, into the mobile app.
- APPROVE/DENY: The user approves or denies the sign-in request, via the mobile app.
The package provides the following routes:
POST /api/guardian/generate- This route is used to generate a Guardian for the user to respond to.
POST /api/guardian/respond- This route is used to respond to the Guardian via the Mobile app.
POST /api/guardian/status- This route is used to verify the user's response and authorize the sign-in.
The Flow:
Desktop
- When the user tries to sign-in on the desktop, and when the user credentials are verified, generate a Guardian for the user to respond to.
- Use the
POST /api/guardian/generateroute to generate a Guardian, with the usersuuid - Once, the guardian is generated, trigger a notification to the user with the GuardianType and the GuardianOption obtained in the previous step.
- Use the
- Poll the
POST /api/guardian/statusroute to check if the user has responded to the Guardian, this can give you three types of results- -1: The user has not responded yet
- 0: The user has responded, with incorrect response
- 1: The user has responded, with the correct response
- Based on the Status, you can either authorize the sign-in or ask the user to respond again or generate a fresh guardian.
Mobile
- Show a UI to the user, based on the GuardianType and GuardianOption
- INPUT: Show a text input to the user, to input the code
- PRESS: Show a list of codes to the user, to press the right code
- APPROVE/DENY: Show two buttons to the user, to approve or deny the sign-in request
- When the user responds, use the
POST /api/guardian/respondroute to send the response to the server.
Installation
You can install the package via composer:
Contributing
This is a community driven package. If you find any errors, please create a pull request with the fix, or at least open an issue.
Testing
Credits
- Rehan Kanak
- All Contributors
License
The MIT License (MIT). Please see License File for more information.