Hellō Identity Provider (IdP) PHP Client Demo
This project demonstrates integrating the Hellō Identity Provider (IdP) in PHP using the HelloCoop PHP library.
- Authenticate users via the Hellō IdP.
- Simple integration with minimal configuration.
- Support for login and logout flows.
-
Create an Application on Hellō
- Visit Hellō Console.
- Create a new application and obtain the App ID.
-
Generate a Secret Key
Run the following command in your terminal to generate a 32-byte hex key:openssl rand -hex 32
-
Set up Ngrok (Optional)
If you want HTTPS redirects during local development, install and run Ngrok.
In the script:
- Replace the placeholder
HOSTwith your domain (use Ngrok if running locally):define('HOST', 'your-ngrok-domain.ngrok-free.app');
- Replace
APP_IDwith your Hellō App ID:define('APP_ID', 'your-app-id-here');
- Replace
SECRETwith your generated secret key:define('SECRET', 'your-secret-key-here');
-
Start PHP's Built-In Server
Navigate to the example folder:php -S localhost:8080
-
Start Ngrok (Optional)
In a separate terminal, start Ngrok for port 8080:ngrok http 8080
Note down the generated HTTPS URL and update the
HOSTconstant in the script. -
Access the Demo
Open the browser and navigate to your server's address (e.g.,https://your-ngrok-domain.ngrok-free.appor your Ngrok domain).
- Login
Click the Continue with Hellō button to initiate the login flow. - Logout
If logged in, the Logout button will be displayed. Use it to end the session. - View Auth Data
The authentication details are displayed in apreblock for debugging purposes.
- Ensure the application is running on HTTPS when deployed.
- Update your Hellō application's redirect URIs to include the appropriate endpoints (
/api/hellocoop).
Enjoy using the Hellō Identity Provider for seamless user authentication!