January, 2015
The code that generates the demos available at demos.janrain.com is available to the public for download at https://github.com/janrain/se-demos. You can review the source code to see how various integrations and functions work.
The Janrain demo site is written in PHP.
-
If you just want to view the source code, the only prerequisite is a text editor to view the source code, and a tool to uncompress the .zip archive.
-
If you want to run the demos on your local machine, you will need a local web server environment with PHP enabled (such as MAMP).
-
If you want to get the Social Login demos running, you will need your own instance of Janrain Social Login. Please contact your Janrain sales representative for an instance of Janrain Social Login.
- Download the
se-demos
git repo from github. - Rename the parent directory and make sure it’s in the web root
- If you are using Social Login, add your API key in a place where the demos can find it (instructions below)
- Test your demo site
Go to https://github.com/janrain/se-demos and click on "Download ZIP"
This will download a zip archive to your local machine: se-demos-master.zip
Unzip the archive. This will create the directory se-demos-master
Rename the directory se-demos-master
to JanrainDemoSites
Move the JanrainDemoSites directory to your web root.
[webroot]/JanrainDemoSites
For example, if you are using MAMP as your local web server, and its web root is
/Applications/MAMP/htdocs
then the path for the Janrain demos should be:
/Applications/MAMP/htdocs/JanrainDemoSites
The files that need the API key are:
JanrainDemoSites/default/templates/socialRedirect/tokenURL.php
and
JanrainDemoSites/default/templates/socialAjax/ajaxScript.php
By default, these files will expect your API key to be in the following location:
[filesystemRoot]/Janrain/apiKey.txt
Create this file (apiKey.txt) and paste your API key in the file. The API key should be the only thing in the file.
Looking at the source code for tokenURL.php and socialAjax.php, you can elect to store your API key in another way if you wish, as long as these files can get the value.
You should be all set now, and your demo site available at:
http://localhost/JanrainDemoSites/
or whatever your web server’s home path is.