Simple PHP project demonstrates basic authentication flows with PlusAuth
Explore the PlusAuth PHP docs »
It is a simple PHP project demonstrating basic authentication flows such as register, login, and logout. Jumbojett\OpenIDConnectClient is used for authentication to keep things simple.
Before running the project, you must first follow these steps:
-
Create a PlusAuth account and a tenant at https://dashboard.plusauth.com
-
Navigate to the
Clientstab and create a client of typeRegular Web Application -
Go to the details page of the client that you've just created and set the following fields as:
-
Redirect Uris: http://localhost:3000/login.php
-
Post-Logout Redirect Uris: http://localhost:3000/
-
Finally, write down your Client Id and Client Secret for server configuration
First, we need to configure the server. Rename .env.example to .env.
Then configure the .env file using your Client Id, Client Secret, and your PlusAuth tenant name.
Note: composer must be installed on your system to install project dependencies.
You can run the project with the following options:
Note: You must have curl and XML extensions for PHP installed and enabled.
Install following packages if not installed on your system
sudo apt-get install composer zip php-curl php-xml
Install dependencies:
composer install
Start the server:
php -S localhost:3000 -t public
Install dependencies:
composer install
Finally, start the server:
docker-compose up
The example is hosted at http://localhost:3000/
The project is licensed under the MIT license. See the LICENSE file for more info.
PlusAuth helps individuals, teams, and organizations to implement authorization and authentication systems in a secure, flexible and easy way.