This example shows how to create a PHP application with user authentication from scratch in PHP, using Okta OAuth 2.0 to handle user registration/login/logout/forgot password.
Please read Build Simple Login in PHP to see how this application was built.
Prerequisites: PHP, Composer, Okta developer account
Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage, and secure users and roles in any application.
Clone this project using the following commands:
git clone [email protected]:oktadeveloper/okta-php-core-login-example.git
cd okta-php-core-login-example
Install the project dependencies, Copy the .env
file and fill in your Okta details:
composer install
cp .env.example .env
From the project directory, run:
php -S 127.0.0.1:8080 -t public
Then open http://localhost:8080
and you will see the application.
Please post any questions as comments on the
, or visit our Okta Developer Forums. You can also email [email protected] if would like to create a support ticket.Apache 2.0, see LICENSE.