CalderaWP/laravel-wp-user

Name: laravel-wp-user

Owner: Caldera Labs

Description: [WIP]Use a WordPress site as the authentication provider for a Laravel app.

Created: 2017-06-23 22:34:08.0

Updated: 2018-04-07 14:05:23.0

Pushed: 2017-07-06 15:24:11.0

Homepage:

Size: 11

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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
Usage
Setting Up WordPress

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

Add WordPress Login To Your App

NOTES:

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

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.