> ## Content Index
> Fetch the complete content index at: https://helpmonks.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Sample Code for Janrain integration for CFML / ColdFusion
- URL: https://helpmonks.com/blog/sample-code-for-janrain-integration-for-cfml-coldfusion/
- Published: 2012-06-03T00:00:00.000Z
- Updated: 2026-04-06T20:07:31.000Z
- Description: Here is a sample code for integration the Janrain Engage social login. This is inspired by the sample codes published over at https://github.com/janrain/Janr
- Author: Nitai
- Tags: email marketing

Here is a sample code for integration the Janrain Engage social login. This is inspired by the sample codes published over at [https://github.com/janrain/Janrain-Sample-Code](https://github.com/janrain/Janrain-Sample-Code?ref=helpmonks.com). (I asked them to integrate the CFML sample code, but they did not reply) Alas, you find the code below or can also get it on Github as well at [https://github.com/thenitai/ColdFusion-Janrain-Sample-Code](https://github.com/thenitai/ColdFusion-Janrain-Sample-Code?ref=helpmonks.com).

<!— This code sample shows how to make the auth\_info API call using CFML —>

<!— Enter your API key here —>  
<cfset variables.apikey = "">

<!— Step 1) Extract the token from your environment —>  
<cfset variables.token = form.token>

<!—  
Step 2) Now that we have the token, we need to make the api call to auth\_info.  
auth\_info expects an HTTP Post with the following paramters:  
—>

<cfhttp url="https://rpxnow.com/api/v2/auth\_info"&gt;  
<cfhttpparam name="token" value="#variables.token#" type="URL">  
<cfhttpparam name="apiKey" value="#variables.apikey#" type="URL">  
</cfhttp>

<!— If status code is 200 —>  
<cfif cfhttp.responseheader.status\_code EQ "200">

<!— Step 3) read the json response —>  
<cfset variables.auth\_info\_json = Deserializejson(cfhttp.filecontent)>

<!— Set default variables which might be in the response (depending on the provider) —>  
<cfparam name="variables.auth\_info\_json.profile.displayName" default="" />  
<cfparam name="variables.auth\_info\_json.profile.email" default="" />  
<cfparam name="variables.auth\_info\_json.profile.photo" default="" />

<!— Step 4) use the response to sign the user in —>  
<cfif variables.auth\_info\_json.stat EQ "OK">  
<!—  
‘identifier’ is the unique idenfifier that you use to sign the user in to your site  
—>  
<cfset variables.identifier = variables.auth\_info\_json.profile.identifier>  
<!—  
get fields  
—>  
<cfset variables.displayName = variables.auth\_info\_json.profile.displayName>  
<cfset variables.email = variables.auth\_info\_json.profile.email>  
<cfset variables.profile\_pic\_url = variables.auth\_info\_json.profile.photo>  
<cfset variables.providerName = variables.auth\_info\_json.profile.providerName>  
<cfset variables.preferredUsername = variables.auth\_info\_json.profile.preferredUsername>  
<!—  
actually sign the user in. this implementation depends highly on your platform, and is up to you.  
—>  
<!— <cfinvoke component="" method=""></cfinvoke> —>

<!— Simply dump variables —>  
<cfdump var="#variables#">

<!— Error with Authentication —>  
<cfelse>  
<h1>Error with the authentication</h1>  
<cfdump var="#variables.auth\_info\_json.err.msg#">  
</cfif>

<!— There is an error with the http response —>  
<cfelse>  
<h1>Error with the HTTP Response</h1>  
<cfdump var="#cfhttp#">  
</cfif>