P. Janrain/RPX Integration
The RPX API allows users to login via social networks and link their social networking accounts to their Zerista account.
OAuth Providers
Zerista integrates with the following OAuth providers via Janrain/RPX.
| ID | Name | Connection URL |
|---|---|---|
| 1 | https://zerista-eval.rpxnow.com/openid/start?openid_identifier=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid | |
| 2 | https://zerista-eval.rpxnow.com/facebook/connect_start?ext_perm=publish_stream%2Cemail%2Coffline_access | |
| 3 | YAHOO | https://zerista-eval.rpxnow.com/openid/start?openid_identifier=http%3A%2F%2Fme.yahoo.com |
| 4 | https://zerista-eval.rpxnow.com/twitter/start | |
| 5 | LIVE | https://zerista-eval.rpxnow.com/liveid/start |
| 6 | AOL | https://zerista-eval.rpxnow.com/openid/start?openid_identifier=http%3A%2F%2Fopenid.aol.com |
| Action | Method | URI |
|---|---|---|
| List Connected Social Network Accounts | GET | /rpx |
| Create Account/Login via Social Network | POST | /rpx/api |
| Link a Social Network Account | POST | /rpx/link_accounts |
| Unlink a Social Network Account | DELETE | /rpx/link_accounts |
Listing Connected Social Network Accounts
The listing includes all the social networking accounts a user has connected with his Zerista account. Sample JSON response:
[
{
"identifier":"http://www.facebook.com/profile.php?id=100001114177241",
"provider_id":2,
"user_id":4,
"username":"zeristadev@gmail.com"
},
{
"identifier":"http://twitter.com/account/profile?user_id=137580616",
"provider_id":4,
"user_id":4,
"username":"zerista_dev1"
}
]
Create Account/Login via Social Network:
A request to this resource is never made directly. It is instead used as a callback URL when connecting with RPX. So to login via Twitter you would make a GET/POST request to the Twitter Connection URL from above and pass the token_url as follows:
GET https://zerista-eval.rpxnow.com/twitter/start?token_url=http%3A%2F%2Fdemo.zerista.com%2Frpx%2Fapi
Once the user logs in via Twitter RPX will then make a POST request to the rpx/api resource.
JSON Response Example
{
"id":3,
"first_name":"Charlie",
"last_name":"Savage",
"display_name":"Charlie",
"account":{
"id":3,
"account_name":"cfis",
"web_links":{
"twitter":"http://twitter.com/cfis"
},
"addresses":[
]
},
"item":{
"id":3,
"display_value":"Charlie Savage",
"created_on":{
"n":0,
"json_class":"Time",
"s":1311183306
},
"updated_on":{
"n":0,
"json_class":"Time",
"s":1311183306
},
"tags":[
"Beer",
"Maps"
],
"icon":{
"id":1082,
"content_type":"image/png",
"versions":{
"small_hover-32":"icon_1082_32_hover.png",
"photo-640":"icon_1082_640.png",
"medium-64":"icon_1082_64.png",
"extra_large-150":"icon_1082_150.png",
"small-32":"icon_1082_32.png",
"logo-200":"icon_1082_200.png",
"large-100":"icon_1082_100.png"
}
},
"article":{
"id":105283866,
"item_id":3,
"content":"<p>a list</p><p></p><p>of</p><p>several</p><p>things</p>"
},
"phones":[
{
"work_number":"123-456-7890",
"fax_number":null,
"cell_number":"098-765-4321"
}
]
},
"employee":{
"position":"CEO",
"company_name":"Zerista, Inc."
}
}
Link a Social Network Account
This is a three step process. For example, for linking a twitter account, the following 3 steps need to be accomplished:
- Make a GET/POST request to the Twitter Connection URL from above and pass the token_url. The resultant link will be:
GET https://zerista-eval.rpxnow.com/twitter/start?token_url=http%3A%2F%2Fdemo.zerista.com%2Frpx%2Ftoken?format=json - After the user logs in to Twitter, RPX post redirects the user to http://demo.zerista.com/rpx/token?format=json. The response to this request is json which includes the rpx token:
{token: '1234'} - Make a POST request to http://demo.zerista.com/rpx/link_accounts passing the RPX token as a form parameter with the name “token”.
Parameter Details Default token Rpx token obtained from step 2 above e.g. ’1234′ If the linking was successful the response would be as follows:
JSON Response Example
{ "identifier":"http://openid.aol.com/zeristadev", "provider_id":6, "user_id":3, "username":"zeristadev" }
Unlink a Social Network Account
Unlink a connected account by making a DELETE request to http://{conference}.zerista.com/rpx/link_accounts and passing a “provider_id”. For example to unlink an existing Twitter account:
DELETE http://{conference}.zerista.com/rpx/link_accounts?provider_id=4
JSON Response Example
{
“identifier”:”http://twitter.com/account/profile?user_id=137580616″,
“provider_id”:4,
“user_id”:4,
“username”:”zerista_dev1″
}