Download the PHP package fluidphp/user-auth-api-helper without Composer
On this page you can find all versions of the php package fluidphp/user-auth-api-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fluidphp/user-auth-api-helper
More information about fluidphp/user-auth-api-helper
Files in fluidphp/user-auth-api-helper
Package user-auth-api-helper
Short Description FluidPhp framework user authentication API
License GPL-2.0-or-later
Homepage http://phptoolcase.com
Informations about the package user-auth-api-helper
FluidPhp User Authentication Api Helper
This is a helper for fluidphp framework, to authenticate users on your website or backend panel
Installation
1 - Add the package to your composer.json to install the helpers
2 - Create "user-auth-api.php" config file in app/config folder and copy the code from "user-auth-api.config.sample.php"
3 - Create "logger.php" file in app/config folder and add your configuration if not present already
4 - Configure "auth.php" in app/config to add the api user model
5- Move email-templates folder in app/views
Usage
Using protected pages filter
Add the filter "_user-auth-api.check_login" to all the routes that require access to authenticated users
Using the api wrapper
The api wrapper is a convenient way to make the calls from js directly, as it can set the session variables directly.
To call the api wrapper u can use any request library
Keep in mind that calling the api directly will not allow session variables to be set.
Calling the authentication api directly
The API should be only called directly within the localhost environment.
To call the authentication api u can use any request library
Endpoints
Wrapper
Register
-
{(http|https)}://{main_doman}/{app_path}/wrapper/register/
- method: post
- description: registers a new user to the database
- params: see config/validator.php
Login
-
{(http|https)}://{main_doman}/{app_path}/wrapper/login/
- method: post
- description: tries to log user in
- params: username, password
- return data: user data
Logout
-
{(http|https)}://{main_doman}/{app_path}/wrapper/logout/
- method: put
- description: removes user session data and autologin cookie
Forgot Password
-
{(http|https)}://{main_doman}/{app_path}/wrapper/forgot-pass/
- method: post
- description: send an email with a link to reset password
- params: username
AutoLogin
-
{(http|https)}://{main_doman}/{app_path}/wrapper/auto-login/{code}/
- method: put
- description: tries to log in with existing login_token
- params: see config/validator.php
- return data: returns user data
Verify Account
-
{(http|https)}://{main_doman}/{app_path}/wrapper/verify/{verificationCode}/
- method: put
- description: tries to verify a user account
Change Password
-
{(http|https)}://{main_doman}/{app_path}/wrapper/change-password/{resetLink}/
- method: post
- description: change user password
- params: see config/validator.php
API
The API should be only called directly within the localhost environment, therefor it is not able to set session variables.
Register
-
{(http|https)}://{USER_AUTH_APP_URL}/{app_path}/account/register/
- method: post
- description: registers a new user to the database
- params: see config/validator.php
Login
-
{(http|https)}://{USER_AUTH_APP_URL}/{app_path}/account/login/
- method: post
- description: tries to log user in
- params: username, password
- return data: user data
Logout
-
{(http|https)}://{USER_AUTH_APP_URL}/{app_path}/account/logout/{code}/
- method: put
- description: removes user session data and autologin cookie
Forgot Password
-
{(http|https)}://{USER_AUTH_APP_URL}/{app_path}/account/forgot-password/
- description: send an email with a link to reset password
- params: username
AutoLogin
-
{(http|https)}://{USER_AUTH_APP_URL}/{app_path}/account/auto-login/{code}/
- method: put
- description: tries to log in with existing login_token
- params: see config/validator.php
- return data: returns user data
Verify Account
-
{(http|https)}://{USER_AUTH_APP_URL}/{app_path}/account/verify/{verificationCode}/
- method: put
- description: tries to verify a user account
Change Password
-
{(http|https)}://{USER_AUTH_APP_URL}/{app_path}/account/change-password/{resetLink}/
- method: post
- description: change user password
- params: see config/validator.php
All versions of user-auth-api-helper with dependencies
mnsami/composer-custom-directory-installer Version 2.0.*
fluidphp/fluidphp Version ^2.0.0
fluidphp/validator-helper Version ^1.0.0
fluidphp/logger-helper Version ^1.0.0
fluidphp/emailmanager-helper Version ^1.0.0
fluidphp/translator-helper Version ^1.0.0
phpmailer/phpmailer Version ^6.7
rmccue/requests Version ^2.0