|
|
OpenID, OAuth and Janrain Integration with your Website or CMS – Easy Registration
|
|
Total Views: 398 - Total Replies: 0
|
Sep 27 2010, 10:01 pm - by sudip
|
Private Message
|
You have probably noticed that now a days you don’t have to register to few websites, they just authorize you using Facebook, Google, MySpace etc. So how do they do this? did this question pop up in your mind lately ? Well OpenID and OAuth are the technologies behind this nifty feature which gives your users the freedom to directly login and socialize with their friends on your site without registering again and again. There by increasing your ROI, proactive user engagement and social sharing all in one step. You will definitely see a significant numbers of registration and conversions if you implement OpenID and OAuth in your site.
Well if you are interested I can show a very simple way to integrate the three cutting edge technologies – OpenID, OAuth and JanRain to implement in your website or CMS. Let’s get started then, firstly you should know a little bit about PHP and MySQL. Though you don’t have to be an expert, just a superficial knowledge is more than sufficient. Before we start lets discuss these technologies a little bit so that your head just don’t start spinning (just kidding).
OpenID OpenID is an open standard or platform that specifies how users can authenticate in a decentralized and distributed manner. So websites and services needs to provide their unique identities and allow users to login thus consolidating their digital identities. The term OpenID also refers to an ID as specified in the OpenID standard; which may take the form of a unique URI, and are managed by some 'OpenID provider' that handles authentication. OpenID authentication is now used and provided by several large websites. Providers include Twitter, Facebook, Google, MySpace, VeriSign, LiveJournal, Yandex, Ustream and Yahoo, OpenID, MyOpenID etc.
OAuth OAuth is a simple way to publish and interact with protected data. It's also a safer and more secure way for people to give you access. It is an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications. If you're storing protected data on your users' behalf, they shouldn't be spreading their passwords around the web to get access to it. Use OAuth to give your users access to their data while protecting their account credentials. OAuth 2.0 is the next evolution of the OAuth protocol which was originally created in late 2006. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. This specification is being developed within the IETF OAuth WG and is based on the OAuth WRAP proposal (http://oauth.net/2/)
Janrain Janrain Engage (formerly RPX - http://www.janrain.com/) is a software development company which integrates OpenID and OAuth and so making it quite easy to implement the whole shabang in a few steps. You need to register for a account at Janrain to get your API Key and integration instructions. Then you need to select and configure services like Facebook, Twitter, Google, Myspace etc with the developer API Keys that you can request from respective service providers. Janrain will help you with direction with how to get those API Keys and you can of course google it.
Now To implement the 3 Ninjas:
Step 1 : Register your account at Janrain, get the API Keys from your selected service providers. Get the sample Html file and rpx.php file.
Step 2 :
INTEGRATION - SAMPLE TEST FILE FROM JANRAIN (jainraintest.html ) In this step the Janrain Widget on your webpage (in my case jainraintest.html) will make a call to the rpx.php file and initiate the login process. Replace yourdomain.com with your domain name
Code :
jainraintest.html
...................................................................................................................................................................................................................................................... Code not shown, pls. refer to project download files give at the bottom of this page ........................................................................................................................... ...........................................................................................................................
Step 3 (Configuring RPX.php):
Configuring RPX core file for API calls, database integration and user login This is the final step where you specify the RPX (Janrain) API Key, get the user credentials and make new database entries for your new users. The principle technique is to get the user details and assign them to designated variables for further processing. One drag though, I cannot get the password details from Janrain system. So what I implemented –
a) Janrain will provide me with user credentials like name, username, email, date of birth, profile pic etc
b) From those values new users must be created in your system (mysql database), using email address as the username. For the password, we will use a MD5 hash encoded string. The user does not need to know the password and neither do you, so hashing it is the best option.
c) Next after we created a database entry with the user details, we directly log the user in (as the user is already authenticated via Janrain so there is no need for separate CAPTCHA codes or other email verifications)
d) For login, you have to use email address as username and random generated
Code :
rpx.php
........................................................................................................................... ........................................................................................................................... Code not shown, pls. refer to project download files give at the bottom of this page ........................................................................................................................... ...........................................................................................................................
Download : Tto download all the project files click here Integrating_Janrain_with_your_CMS.zip or type this url in your browser address bar : http://www.todleho.com/downloads/Integrating_Janrain_with_your_CMS.zip Password : todlehorocks10
Tags : OpenID, OAuth, Janrain, Integration, Website, CMS, Facebook, MySpace, Twitter
|
|
|
|
|
|
|
|
Copyright © 2011 Todleho, All rights reserved
|
|
|