wp-auth0 is a basic tool for integrating Auth0 into PHP projects. It allows you to easily incorporate Auth0 authentication into your PHP applications, including WordPress themes.
This repository is available at https://github.com/kmusiclife/wp-auth0.
The official Auth0 description can be found here https://auth0.com/docs/quickstart/webapp/php .
To get started with wp-auth0, follow these steps:
- Clone the repository or download the source code from https://github.com/kmusiclife/wp-auth0.
git clone https://github.com/kmusiclife/wp-auth0
- Run composer install in the root directory of your project to download and install the required packages.
cd wp-auth0
composer update
composer install
- Create a new
.env
file in the root directory of your project. This file will store your Auth0 credentials and configuration. Make sure to include the following variables:
touch .env
AUTH0_CLIENT_ID=xxxxxxxxxxxxxxxxxx
AUTH0_DOMAIN=xxxxxxxxxxxxxxxxxxxxx
AUTH0_CLIENT_SECRET=xxxxxxxxxxxxxx
AUTH0_COOKIE_SECRET=xxxxxxxxxxxxxx
AUTH0_BASE_URL=xxxxxxxxxxxxxxxxxxx
- Include the
wp-auth0.php
file in your PHP project:
include('wp-auth0/wp-auth0.php');
Once you have included the wp-auth0.php
file, you can start using the wp-auth0 library in your PHP code. It provides functions and methods for handling user authentication and authorization using Auth0.
Here's a simple example of authenticating a user with Auth0:
<?php
include('wp-auth0/wp-auth0.php');
$session->user; // user information
?>
For more advanced usage and configuration options, please refer to the documentation.
wp-auth0 is released under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.
wp-auth0 is built on top of the Auth0 PHP SDK, which provides the underlying functionality for authentication and authorization. Special thanks to the Auth0 team for their excellent work.