Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-10-2009, 02:39 AM   PM User | #1
HDivX
New to the CF scene

 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
HDivX is an unknown quantity at this point
Exclamation JSON Sign In

I'm using RPXNow.com and it's like this openID sign in thing. But I need help. It gives you a code for the sign in widget. EZ, but then when it sends the request and the token_url and auth_info I don't get it.

Extra Info:

1) Add the sign-in interface to your website

The sign-in interface can be displayed in a "popup" overlay on top of your page, or embedded as an iframe. Choose the option below that best fits your needs.

Popup Instructions
Embed Instructions
Add the following javascript code to the bottom of each page where you'd like users to sign in:

<script src="https://rpxnow.com/openid/v2/widget"
type="text/javascript"></script>
<script type="text/javascript">
RPXNOW.overlay = true;
RPXNOW.language_preference = 'en';
</script>
Copy the following signin/signup link to your pages:

<a class="rpxnow" onclick="return false;"
href="https://hdivx-login.rpxnow.com/openid/v2/signin?token_url=your_token_url">
Sign In
</a>
Any link with the class rpxnow that is on a page with the RPX javascript will popup the sign-in interface. Set the token_url parameter in the link to the URL on your website which will handle the RPX response, and make sure it is properly URL-escaped. See step 2 below for more about the token_url. The onclick and href attributes make sure RPX works properly for users with javascript disabled. The href is also used by the popup widget to configure itself.


Also, you may configure which providers show up in your widget and in what order from the Providers page.

2) Receive the RPX token, and get the authentication information

After a successful authentication, RPX redirects the user back to the token_url at your website as specified in step 1. Write some code to handle requests to your token_url, and extract the token POST parameter.

Make the auth_info API call

HTTP POST to https://rpxnow.com/api/v2/auth_info with the following required parameters:

apiKey 6e66a8f57b886310b349ac40c155f0623969a768
token Use the token sent to your token_url
RPX will respond with a JSON formatted response including the identifier of the user.

{
"profile": {
"displayName": "brian",
"preferredUsername": "brian",
"url": "http:\/\/brian.myopenid.com\/",
"providerName": "Other",
"identifier": "http:\/\/brian.myopenid.com\/"
},
"stat": "ok"
}
Use the identifier as the unique key to sign the user in to your website. If it's easier for you to parse XML, pass the optional format parameter to auth_info with a value of xml. You'll get a response like this:

<?xml version='1.0' encoding='UTF-8'?>
<rsp stat='ok'>
<profile>
<displayName>
brian
</displayName>
<identifier>
http://brian.myopenid.com/
</identifier>
<preferredUsername>
brian
</preferredUsername>
<providerName>
Other
</providerName>
<url>
http://brian.myopenid.com/
</url>
</profile>
</rsp>

Last edited by HDivX; 12-10-2009 at 02:41 AM..
HDivX is offline   Reply With Quote
Old 12-10-2009, 09:48 AM   PM User | #2
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
errr... what is this? A question or a presentation of an widget? I guess you posted it in the wrong Forum.
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Reply

Bookmarks

Tags
hdivx, json, login, openid, rpx

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:36 AM.


Advertisement
Log in to turn off these ads.