PHPackages                             calderawp/laravel-wp-user - 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. calderawp/laravel-wp-user

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

calderawp/laravel-wp-user
=========================

Use WordPress for authentication, user managment in laravel app

0.2.0(8y ago)191512GPLv2+PHP

Since Jul 6Pushed 6y ago4 watchersCompare

[ Source](https://github.com/CalderaWP/laravel-wp-user)[ Packagist](https://packagist.org/packages/calderawp/laravel-wp-user)[ RSS](/packages/calderawp-laravel-wp-user/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

laravel-wp-user
===============

[](#laravel-wp-user)

Use a WordPress site as the authentication provider for a Laravel app.

Also can act as a WordPress REST API client.

Goals and Status
----------------

[](#goals-and-status)

- Authenticate as a WordPress user from Laravel - done.
- Provide an API client for querying the WordPress REST API from Laravel - done.
- Provide a WordPress based middleware. - Next step

Usage
-----

[](#usage)

### Setting Up WordPress

[](#setting-up-wordpress)

This library could use other authentication systems but only JWT is implimented.

- Have WordPress 4.7 or later
- Install [JWT Authentication for the WP REST API](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
- Set the right constants as describe in the plugin's readme.
- Activate plugin

### Add WordPress Login To Your App

[](#add-wordpress-login-to-your-app)

- Config

    - Publish config and set url for WordPress site or use `WPUSERWPURL` in your .env
    - URL must include `/wp-json/` (or whatever) you use WITH trailing slash.
- Add a login route, for example

```
Route::post('/wp-login', function( \calderawp\WPUser\JWTAuthenticator $authenticator, \Illuminate\Http\Request $request ){
	if( $request->has( 'username' ) && $request->has( 'password' ) ){
		if( $authenticator->login( $request->input( 'username'), $request->input( 'password' ) ) ){
			$user = \calderawp\WPUser\Model\Model::fromAuth( $authenticator );
		}

		//return an error;
	}
});

```

NOTES:

- This uses a User Model from the package. No migration is provided to save.
- You could save the WP User in database, with token.

### Example To Authenticate User

[](#example-to-authenticate-user)

```
    //SUPER IMPORTANT to use a trialing slash after wp-json
    $wpApiUrl = 'https://roysivan.com/wp-json/';
    $authClient = \calderawp\WPUser\Factory::jwtAuthenticator( $wpApiUrl, [
        //args to pass to constructor of GuzzleHttp\Client
     ] );

    //BTW- in local testing, might want to set verify false
    // $authClient = \calderawp\WPUser\Factory::jwtAuthenticator( $wpApiUrl, [ 'verify' => false ] );

    //authenticate
    if( $authClient->login( 'josh', '12345' ) ){
        $api = \calderawp\WPUser\Factory::jwtAuthenitcated( $wpApiUrl, $authClient->getUser(),
            [
                //args to pass to constructor of GuzzleHttp\Client
             ]
        );
        $me = $api->me();
    }

```

License
-------

[](#license)

Copyright 2017 CalderaWP LLC. Licensed under the terms of the GNU GPL V2+. Please share with your neighbor.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca938daf3f2a666cd32c7bdb6e30714da6fe0e6cd5012fe4864b18afae43fbcd?d=identicon)[Shelob9](/maintainers/Shelob9)

---

Top Contributors

[![Shelob9](https://avatars.githubusercontent.com/u/1994311?v=4)](https://github.com/Shelob9 "Shelob9 (11 commits)")

### Embed Badge

![Health badge](/badges/calderawp-laravel-wp-user/health.svg)

```
[![Health](https://phpackages.com/badges/calderawp-laravel-wp-user/health.svg)](https://phpackages.com/packages/calderawp-laravel-wp-user)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[overtrue/socialite

A collection of OAuth 2 packages.

1.4k5.6M90](/packages/overtrue-socialite)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

121242.9k1](/packages/ellaisys-aws-cognito)

PHPackages © 2026

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