This example project uses Janrain's Social Login widget and Bootstrap to create a sign-in and registration UI powered by PHP and Janrain APIs on the back-end.
- Janrain Social Login (aka Engage) application
- Janrain Registration (aka Capture) application
- PHP web server or local environment (eg. LAMP, MAMP, WAMP, etc.)
-
Create a new Janrain Login API client using the
/clients/addAPI call:curl -X POST \ -d client_id=APPLICATION_OWNER_CLIENT_ID \ -d client_secret=APPLICATION_OWNER_CLIENT_SECRET \ -d description='Native API examples login client' \ -d features='["login_client"]' \ https://YOUR_APP.janraincapture.com/clients/add -
Add the
default_flow_namesetting to the login client you created in step 1 (The flow name is usually "standard" but check with your Janrain representative if in doubt):curl -X POST \ -d client_id=APPLICATION_OWNER_CLIENT_ID \ -d client_secret=APPLICATION_OWNER_CLIENT_SECRET \ -d for_client_id=LOGIN_CLIENT_ID_FROM_STEP_1 \ -d key=default_flow_name \ -d value=standard \ https://YOUR_APP.janraincapture.com/settings/set -
Add the
default_flow_versionsetting to the login client you created in in step 1 (The flow version must be provided by your Janrain representative):curl -X POST \ -d client_id=APPLICATION_OWNER_CLIENT_ID \ -d client_secret=APPLICATION_OWNER_CLIENT_SECRET \ -d for_client_id=LOGIN_CLIENT_ID_FROM_STEP_1 \ -d key=default_flow_version \ -d value=497f2277-a8ca-418e-a6dd-e7d30fabe7df \ https://YOUR_APP.janraincapture.com/settings/set -
Download the source code or fork and clone this repository.
-
Unzip the files into your web server root. For example:
unzip janrain-php-bootstrap-example-master.zip -d /var/www -
Rename
config.example.phptoconfig.php. -
Add the client ID and secret for login client you created in step 1 to the
config.phpfile. -
Navigate to the project in your web browser. Eg.
http://localhost/janrain-php-bootstrap-example-master/
