PHPackages                             fluidphp/user-auth-api-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. fluidphp/user-auth-api-helper

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

fluidphp/user-auth-api-helper
=============================

FluidPhp framework user authentication API

v1.0.5-stable(2y ago)013GPL-2.0-or-laterPHPPHP 5.4.0 - 7.4

Since Sep 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ground-creative/fluidphp-user-auth-api-helper)[ Packagist](https://packagist.org/packages/fluidphp/user-auth-api-helper)[ Docs](http://phptoolcase.com)[ RSS](/packages/fluidphp-user-auth-api-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

FluidPhp User Authentication Api Helper
=======================================

[](#fluidphp-user-authentication-api-helper)

This is a helper for fluidphp framework, to authenticate users on your website or backend panel

Installation
------------

[](#installation)

1 - Add the package to your composer.json to install the helpers

```
"require":
{
	"mnsami/composer-custom-directory-installer": "2.0.*" ,
	"fluidphp/user-auth-api-helper": "^1.0.0"
} ,
"extra":
{
	"installer-paths":
	{
		"./vendor/fluidphp/helpers/Translator": ["fluidphp/translator-helper"] ,
		"./vendor/fluidphp/helpers/Validator": ["fluidphp/validator-helper"],
		"./vendor/fluidphp/helpers/Logger": ["fluidphp/logger-helper"],
		"./vendor/fluidphp/helpers/EmailManager": ["fluidphp/emailmanager-helper"],
		"./vendor/fluidphp/helpers/UserAuthApi": ["fluidphp/user-auth-api-helper"]
	}
}

```

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

```
return
[
	'develop'	=>
	[
		'connection'	=>	'default' ,
		'table'		=>	'log'
	] ,
	'prod'	=>
	[
		'connection'	=>	'default' ,
		'table'		=>	'log'
	]
];

```

4 - Configure "auth.php" in app/config to add the api user model

```
'model'	=>	'\helpers\UserAuthApi\models\Users',

```

5- Move email-templates folder in app/views

Usage
-----

[](#usage)

### Using protected pages filter

[](#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

[](#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

```
$app = \App::option('app');
try
{
	$request = Requests::post($app['url'] . $app['env'] . '/wrapper/reset-password/', [], ['username' => 'some_user_name']);
	return $request->body;
}
catch (\Throwable $e)
{
	return '{"error": 1, "message": "' . $e->getMessage() . '", "code": ' . $e->getCode(). '}';
}

```

Keep in mind that calling the api directly will not allow session variables to be set.

### Calling the authentication api directly

[](#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

```
$app = \App::option('app');
try
{
	$request = Requests::put($app['url'] . $app['env'] . '/account/asutologin/'. $code . '/');
	return $request->body;
}
catch (\Throwable $e)
{
	return '{"error": 1, "message": "' . $e->getMessage() . '", "code": ' . $e->getCode(). '}';
}

```

Endpoints
---------

[](#endpoints)

### Wrapper

[](#wrapper)

#### Register

[](#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

[](#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

[](#logout)

- {(http|https)}://{main\_doman}/{app\_path}/wrapper/logout/

    - method: put
    - description: removes user session data and autologin cookie

#### Forgot Password

[](#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

[](#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

[](#verify-account)

- {(http|https)}://{main\_doman}/{app\_path}/wrapper/verify/{verificationCode}/

    - method: put
    - description: tries to verify a user account

#### Change Password

[](#change-password)

- {(http|https)}://{main\_doman}/{app\_path}/wrapper/change-password/{resetLink}/

    - method: post
    - description: change user password
    - params: see config/validator.php

### API

[](#api)

The API should be only called directly within the localhost environment, therefor it is not able to set session variables.

#### Register

[](#register-1)

- {(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

[](#login-1)

- {(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

[](#logout-1)

- {(http|https)}://{USER\_AUTH\_APP\_URL}/{app\_path}/account/logout/{code}/

    - method: put
    - description: removes user session data and autologin cookie

#### Forgot Password

[](#forgot-password-1)

- {(http|https)}://{USER\_AUTH\_APP\_URL}/{app\_path}/account/forgot-password/

    - description: send an email with a link to reset password
    - params: username

#### AutoLogin

[](#autologin-1)

- {(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

[](#verify-account-1)

- {(http|https)}://{USER\_AUTH\_APP\_URL}/{app\_path}/account/verify/{verificationCode}/

    - method: put
    - description: tries to verify a user account

#### Change Password

[](#change-password-1)

- {(http|https)}://{USER\_AUTH\_APP\_URL}/{app\_path}/account/change-password/{resetLink}/

    - method: post
    - description: change user password
    - params: see config/validator.php

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

979d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8352e76f8a98f5253281053fa04631890f21b9d50aaaa14776daf3bc3348c4d2?d=identicon)[ground-creative](/maintainers/ground-creative)

---

Top Contributors

[![ground-creative](https://avatars.githubusercontent.com/u/1550792?v=4)](https://github.com/ground-creative "ground-creative (26 commits)")

---

Tags

php framework

### Embed Badge

![Health badge](/badges/fluidphp-user-auth-api-helper/health.svg)

```
[![Health](https://phpackages.com/badges/fluidphp-user-auth-api-helper/health.svg)](https://phpackages.com/packages/fluidphp-user-auth-api-helper)
```

###  Alternatives

[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
