PHPackages                             nicumicle/simple-jwt-login-client-php - 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. nicumicle/simple-jwt-login-client-php

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

nicumicle/simple-jwt-login-client-php
=====================================

Simple JWT Login Client composer package

1.0.2(11mo ago)51.8k↓33.3%2[1 issues](https://github.com/nicumicle/simple-jwt-login-client-php/issues)GPL-2.0-or-laterPHPPHP &gt;=5.6CI failing

Since Dec 4Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/nicumicle/simple-jwt-login-client-php)[ Packagist](https://packagist.org/packages/nicumicle/simple-jwt-login-client-php)[ Docs](https://github.com/nicumicle/simple-jwt-login-client-php)[ RSS](/packages/nicumicle-simple-jwt-login-client-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

 [![](https://camo.githubusercontent.com/2d499512e592ea47ca85ede88c31a2d8a21b73d7e537f635544fa03f18b55974/68747470733a2f2f70732e772e6f72672f73696d706c652d6a77742d6c6f67696e2f6173736574732f62616e6e65722d373732783235302e706e673f7265763d32313036303937)](https://camo.githubusercontent.com/2d499512e592ea47ca85ede88c31a2d8a21b73d7e537f635544fa03f18b55974/68747470733a2f2f70732e772e6f72672f73696d706c652d6a77742d6c6f67696e2f6173736574732f62616e6e65722d373732783235302e706e673f7265763d32313036303937)

 [![](https://github.com/nicumicle/simple-jwt-login-client-php/actions/workflows/build.yml/badge.svg)](https://github.com/nicumicle/simple-jwt-login-client-php/actions/workflows/build.yml/badge.svg) [![](https://camo.githubusercontent.com/c86f1f19a7492bd25974b36e3eb21a107da8a9d5d5e5af38f26c8f405006f057/68747470733a2f2f636f6465636f762e696f2f67682f6e6963756d69636c652f73696d706c652d6a77742d6c6f67696e2d636c69656e742d7068702f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d4236326b545866503630)](https://camo.githubusercontent.com/c86f1f19a7492bd25974b36e3eb21a107da8a9d5d5e5af38f26c8f405006f057/68747470733a2f2f636f6465636f762e696f2f67682f6e6963756d69636c652f73696d706c652d6a77742d6c6f67696e2d636c69656e742d7068702f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d4236326b545866503630)

[![Latest Stable Version](https://camo.githubusercontent.com/abaea100fbf66c8adf85c24022b8273a1c77029c8fe344837157ac7d82eaf7fe/687474703a2f2f706f7365722e707567782e6f72672f6e6963756d69636c652f73696d706c652d6a77742d6c6f67696e2d636c69656e742d7068702f76)](https://packagist.org/packages/nicumicle/simple-jwt-login-client-php)[![Total Downloads](https://camo.githubusercontent.com/7c35643d26ae353e6d5ea8823c77d4b6622332a8011115c5731059eb9a588e89/687474703a2f2f706f7365722e707567782e6f72672f6e6963756d69636c652f73696d706c652d6a77742d6c6f67696e2d636c69656e742d7068702f646f776e6c6f616473)](https://packagist.org/packages/nicumicle/simple-jwt-login-client-php)[![License](https://camo.githubusercontent.com/78a39cb20192dcfe87af47018abab86e6cb3882687cb9eee39ec880b837485fa/687474703a2f2f706f7365722e707567782e6f72672f6e6963756d69636c652f73696d706c652d6a77742d6c6f67696e2d636c69656e742d7068702f6c6963656e7365)](https://packagist.org/packages/nicumicle/simple-jwt-login-client-php)[![PHP Version Require](https://camo.githubusercontent.com/e782606460989f08938d607a6a300c7392506371b918b4df2d21e58c1ccb53e2/687474703a2f2f706f7365722e707567782e6f72672f6e6963756d69636c652f73696d706c652d6a77742d6c6f67696e2d636c69656e742d7068702f726571756972652f706870)](https://packagist.org/packages/nicumicle/simple-jwt-login-client-php)

The simple-jwt-login PHP client
===============================

[](#the-simple-jwt-login-php-client)

This client will help you integrate your PHP Application with a WordPress website that is using the [simple-jwt-login](https://wordpress.org/plugins/simple-jwt-login) WordPress plugin.

Requirements
------------

[](#requirements)

- PHP : &gt;=5.6
- curl extension

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

[](#installation)

```
    composer require nicumicle/simple-jwt-login-client-php

```

Simple Example
--------------

[](#simple-example)

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com');

    $result = $simpleJwtLogin->registerUser('email@test.com', 'My-password');

    //var_dump($result);
```

The output of result will be the actual API call result.

How to use it
-------------

[](#how-to-use-it)

### Login User

[](#login-user)

In order to autologin, you will need to redirect to the WordPress website, with the generated URL:

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    header('Location: ' . $simpleJwtLogin->getAutologinUrl('My JWT', 'AUTH CODE', 'https://test.com'));
```

The Auth Code parameter is optional. You can set it to `null` If you don't want to use it.

### Register User

[](#register-user)

This will register a new user.

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->registerUser('email@simplejwtlogin.com', 'password', 'AUTH CODE');
```

The Auth Code parameter is optional. You can set it to `null` If you don't want to use it.

The $result value is:

```
Array
(
    [success] => true
    [id] => 1
    [message] => User was successfully created.
    [user] => Array
        (
            [ID] => 1
            [user_login] => test@simplejwtlogin.com
            [user_nicename] => test@simplejwtlogin.com
            [user_email] => test@simplejwtlogin.com
            [user_url] =>
            [user_registered] => 2021-28-01 15:30:37
            [user_activation_key] =>
            [user_status] => 0
            [display_name] => test@simplejwtlogin.com
            [user_level] => 10
        )

    [jwt] => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
)

```

### Delete User

[](#delete-user)

This will delete a user.

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->deleteUser('Your JWT here', 'AUTH CODE');
```

The Auth Code parameter is optional. You can set it to `null` If you don't want to use it.

The $result value is:

```
Array
(
    [message] => User was successfully deleted.
    [id] => 1
)

```

### Reset Password

[](#reset-password)

This will send the reset password email.

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->resetPassword('email@simplejwtlogin.com', 'AUTH CODE');
```

The Auth Code parameter is optional. You can set it to `null` If you don't want to use it.

The $result value is:

```
Array
(
    [success] => true
    [message] => Reset password email has been sent.
)

```

### Change password

[](#change-password)

This will send the reset password email. The Auth Code parameter is optional. You can set it to `null` If you don't want to use it.

The following code part, will change the user password, using the reset password code:

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->changePassword('email@simplejwtlogin.com', 'new password', 'code', null, 'AUTH CODE');
```

The following code part, will change the user password, using a JWT:

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->changePassword('email@simplejwtlogin.com', 'new password', null, 'Your JWT here', 'AUTH CODE');
```

The $result value is:

```
Array
(
    [success] => true
    [message] => User Password has been changed.
)

```

### Authenticate User

[](#authenticate-user)

The Auth Code parameter is optional. You can set it to `null` If you don't want to use it.

#### Authenticate

[](#authenticate)

This will generate a JWT based on user credentials.

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->authenticate('email@simplejwtlogin.com', 'your password', 'AUTH CODE');
```

The $result value is:

```
Array
(
    [success] => true
    [data] => Array
        (
            [jwt] => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
        )

)

```

#### Refresh token

[](#refresh-token)

+The following code will refresh an expired token:

```
    $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->refreshToken('your JWT here', 'AUTH CODE');
```

The $result value is:

```
Array
(
    [success] => true
    [data] => Array
        (
            [jwt] => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
        )

)

```

#### Validate token

[](#validate-token)

The following code will check if your JWT is valid or not:

```
   $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
    $result = $simpleJwtLogin->validateToken('your JWT here', 'AUTH CODE');
```

The $result value is:

```
Array
(
    [success] => true
    [data] => Array
        (
            [user] => Array
                (
                    [ID] => 1
                    [user_login] => test@simplejwtlogin.com
                    [user_nicename] => test@simplejwtlogin.com
                    [user_email] => test@simplejwtlogin.com
                    [user_url] => https://simplejwtlogin.com
                    [user_registered] => 2021-28-01 15:30:37
                    [user_activation_key] =>
                    [user_status] => 0
                    [display_name] => test@simplejwtlogin.com
                )

            [jwt] => Array
                (
                    [0] => Array
                        (
                            [token] => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
                            [header] => Array
                                (
                                    [typ] => JWT
                                    [alg] => HS256
                                )

                            [payload] => Array
                                (
                                    [iat] => 1638459037
                                    [email] => test@simplejwtlogin.com
                                    [id] => 1
                                    [site] => http://localhost
                                    [username] => test@simplejwtlogin.com
                                )

                        )

                )

        )

)

```

#### Revoke token

[](#revoke-token)

The following code will invalidate a JWT:

```
   $simpleJwtLogin = new SimpleJwtLoginClient('https://mydomain.com', '/simple-jwt-login/v1');
   $result = $simpleJwtLogin->revokeToken('your JWT here', 'AUTH CODE');
```

The $result value is:

```
Array
(
    [success] => true
    [message] => Token was revoked.
    [data] => Array
        (
            [jwt] => Array
                (
                    [0] => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
                )
        )
)

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance48

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~645 days

Total

3

Last Release

336d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20170987?v=4)[Nicu Micle](/maintainers/nicumicle)[@nicumicle](https://github.com/nicumicle)

---

Top Contributors

[![nicumicle](https://avatars.githubusercontent.com/u/20170987?v=4)](https://github.com/nicumicle "nicumicle (8 commits)")[![eleonorsomosot](https://avatars.githubusercontent.com/u/13271143?v=4)](https://github.com/eleonorsomosot "eleonorsomosot (4 commits)")

---

Tags

simple-jwt-loginsimple-jwt-login-client

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nicumicle-simple-jwt-login-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/nicumicle-simple-jwt-login-client-php/health.svg)](https://phpackages.com/packages/nicumicle-simple-jwt-login-client-php)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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