Download the PHP package midorikocak/nanoauth without Composer
On this page you can find all versions of the php package midorikocak/nanoauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download midorikocak/nanoauth
More information about midorikocak/nanoauth
Files in midorikocak/nanoauth
Package nanoauth
Short Description Nano Auth is a library that allows you to create authentication for your apps.
License MIT
Homepage https://github.com/midorikocak/nano
Informations about the package nanoauth
Nano Auth
Nano Auth is a library that allows you to create authentication for your apps.
Requirements
Strictly requires PHP 7.4.
Install
Via Composer
Usage
Authentication
The Authentication class has 4 public methods that you can use:
To use it you should supply with a user repository.
User implements UserInterface
A user object that we can authenticate should implemennt UserInterface
.
UserRepository
To interact with user data, we need to supply user repository to our authentication object. If you want to use your own
implementation of user repository, you can implement your own UserInnterface
.
Here repository constructor expects a NanoDB
object.
Authorization
To add authentication and authorization capabilities,
you can use AuthorizationTrait
in your App classes.
Let's say we created our app in this way:
To check login we should trigger checkLogin()
method in our public methods.
Motivation
Mostly educational purposes.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Midori Kocak
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of nanoauth with dependencies
ext-json Version *
midorikocak/arraytools Version ^1.0
midorikocak/nanodb Version ^1.2.3