Welcome Developers!

in

Welcome!

in

How do you require users to login

Last post 01-06-2010 5:31 PM by Joel. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-15-2009 8:31 AM

    How do you require users to login

    I want to achieve something similar to this app.  If the users are not logged in, they are redirected to the myspace login form.  And after logging in, redirected back to the app.

    http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=110226

  • 01-15-2009 6:54 PM In reply to

    Re: How do you require users to login

    Not sure how to do it like that exactly, but just check if they are logged in by seeing if the user id is null. If it is, prompt them to log in by supplying a link.
  • 01-05-2010 9:40 PM In reply to

    • sandy
    • Not Ranked
    • Joined on 03-12-2008
    • Posts 3

    Re: How do you require users to login

     Hi Guys,

    Can anybody give me update on this post.. I'm using following code to check..

    <?php

    include_once("myspace/MySpaceAPI.php");
    include_once("Config.php"); // <-- SET YOUR KEY/SECRET HERE
       
        // Set the key - application uri - secret key
        $myspace = new MySpaceAPI(Config::$APP_OAUTH_CONSUMER_KEY, Config::$APP_OAUTH_CONSUMER_SECRET);
       
        // Get XML, JSON
        //$myspace->set_output_array(false); //set to false to get the XML or JSON format instead of native php arrays
        //$myspace->set_response_type(ResponseType::$JSON); //change the type to XML, JSON
       
        $user_id = $_REQUEST["viewerId"]; //264730435; // <-- CHANGE to yours (you can get this from the iframe querystring for owner id and viewer id)

    if($user_id == "")
    {
        header("location:add_app.php");
        exit();
    }

    ?>

     But  this is not working for me. Please reply to me ASAP.

    Regards

    Sandy

  • 01-06-2010 5:31 PM In reply to

    Re: How do you require users to login

     Sandy,

    What error are you getting? It is possible this sdk is outdated and needs attention. But I would need to know what the user experience is first.

     

    thanks,

    Joel

Page 1 of 1 (4 items)