Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: JSON Sign In

  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    errr... what is this? A question or a presentation of an widget? I guess you posted it in the wrong Forum.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •