Authgear is a secure authentication and user management platform. It uses OpenID Connect (OIDC) and OAuth 2.0 to identify who a user is and grant authorization to protected resources.
This example app is written in regular PHP without any framework. It uses Authgear to allow users to log in to a website and request protected resources.
- Before you run this project on your local machine, sign up for a free Authgear account.
- Create an Authgear app, of type OIDC in Authgear Portal.
- Clone this project on your local machine by running the following command:
git clone https://github.com/authgear/authgear-example-php.git
- Add the configuration (
Client ID
,Client Secret
,Authgear App URL
,Redirect URI
) for your Authgear app to the.env
file. - Run
composer update
- Run the project on your local PHP/Apache server like XAMPP/WAMP or via CLI
For a more detailed step-by-step guild on how to use Authgear with PHP, check out this post: https://docs.authgear.com/get-started/regular-web-app