MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Authentication in REST api

Last post 04-09-2008 4:23 PM by Hristo. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 03-13-2008 6:17 AM

    • Asaf
    • Not Ranked
    • Joined on 03-11-2008
    • Posts 4

    Authentication in REST api

    Hi,

     I read the Authentication section in MySpace REST API dcoumentation, and haven't figured out where is the login to MySpace is performed?

    They only describe there one passkey: The application secret key.

    What about an authentication token created by signing in to MySpace, using the username/password?

     

    Asaf

     

    Filed under: ,
  • 03-13-2008 7:59 AM In reply to

    Re: Authentication in REST api

    RESTful web services can only be called from off-site (onsite you use either the JS or AS libraries). You cannot proxy a log-in from off-site. You put the two together and you get: you don't use session tokens to make RESTful calls. No login is required, just the Id of an Installed user, to make resource request against the API.

  • 03-28-2008 12:15 AM In reply to

    Re: Authentication in REST api

    Hi Jeremy, I am developing my application in Flex. And only way to get MySpace data is through REST API. But, I am able to make calls over api.msappspace.com but not on api.myspace.com. As per your comments, I understood that I should not use REST API from my flex app. Then, what is the other way for me? Can you please help me?
    Filed under:
  • 03-28-2008 1:36 AM In reply to

    Re: Authentication in REST api

    Yeah, my reply above is slightly outdated, so forgive me for any errors that it might have.

    There's an Official AS3 library for use with Flex, check out the Libraries under the Reference section: http://developer.myspace.com/community/libs/libraryintro.aspx

    I haven't really used it, though. Flash simply isn't my strong suit, but the page linked above contains links to both the library and the thread on this forum where it's being discussed. A number of people have gotten it up and running, so I'm sure you can find any help you need there.

    **edit**

    Turns out I was wrong - the link is supposed to be to the library documentation, which isn't up yet. The thread for the library is here: http://developer.myspace.com/Community/forums/t/611.aspx

    You can download the AS3 library from the first link above, though.

  • 03-28-2008 2:17 AM In reply to

    Re: Authentication in REST api

    Prabhakar:
    I am able to make calls over api.msappspace.com
     

    As far as I understand what you are doing is fine.

    Eddie 

  • 03-28-2008 6:44 AM In reply to

    Re: Authentication in REST api

    Hi, First let me thank you for your info. But, I am unable to find the documentation for the REST API Endpoints for api.msappspace.com. I dont have information regarding the AppData and Activity APIs for this domain. The REST API listings at http://developer.myspace.com/community/RestfulAPIs/resources.aspx are completely for api.myspace.com which I cannot use in my Flex application. It would be fine if MySpace guys can provide the REST API for Flex applications... :(
  • 03-28-2008 8:03 AM In reply to

    Re: Authentication in REST api

    Check the other Actionscript threads here or do a search as I'm sure I listed the calls that I got to work somewhere while back.

    You can retrieve AppData - again the call is in the forum somewhere - but updatings more of  a struggle - again check threads

    (Search box is at top of forums and I'd start with Actionscript then if its not enough try Flash, Flex etc )

    Activity APIs - not released yet

    Eddie 

     

  • 03-28-2008 8:11 AM In reply to

    Re: Authentication in REST api

    The end-points are the same, by the way. Just change 'api.myspace.com' to 'api.msappspace.com' -- if you want to verify, you can use the API Tool.

  • 04-02-2008 9:53 PM In reply to

    Re: Authentication in REST api

    Thank you Jeremy. Let me use the API tool and come back.
  • 04-02-2008 10:02 PM In reply to

    Re: Authentication in REST api

    :(( Where is the tool? Its gone.... :((
  • 04-03-2008 5:25 AM In reply to

    Re: Authentication in REST api

    It's under the Test link on the left menu -> Api Tool.

    http://developer.myspace.com/modules/apis/pages/devtool.aspx

  • 04-08-2008 5:40 AM In reply to

    Re: Authentication in REST api

    Thank you Jeremy. I am just checking it.

  • 04-09-2008 2:17 PM In reply to

    • Hristo
    • Not Ranked
    • Joined on 04-03-2008
    • Posts 4

    Re: Authentication in REST api

     I have a mobile application. This aplication will consult the list of friends of the MySpace user logged in this app. To loggin to the app the user have to insert the email and pass in the custom interface that have the app, without using browser or somting like that. So I need in the server side make the authentication from a servlet  sending the requested data and   then consult the Friends ids.

     

    Is posible to do this with the Rest Api using JAVA, conecting server to server? 

  • 04-09-2008 3:46 PM In reply to

    Re: Authentication in REST api

    Not as such, no.

    The problem comes from the fact that your mobile device has no browser, and MySpace does not allow a third-party to proxy log-in requests. Your App could bounce a browser to MySpace, have the user sign-in, then bounce back to your App with a token, but it still requres the user to enter the information directly into the MySpace website. You can't automate that.

    However, there is an alternative, and due to the security limits placed on the RESTful API, it's not onerous. It requires three parts, though. First, the mobile application that will interface with the user; second, a server which will handle a seperate login mechanism (not a MySpace login, your App's own), third, a MySpace App that must be installed on a User's account to allow access to their data RESTfully.

    Let's pretend your mobile application is called MyMobileSpace (note: you cannot use that name - it violates the ToS; this is just an example), and it's counterpart MySpace App is called MyMobileSpace Enabler. When the user installs MyMobileSpace Enabler on their account, it asks them to create a login for MyMobileSpace (or to link to one they already created). You can have it ask for some username and password combo; once they do, you send that information, along with their MySpace userId, to the server that handles the login.

    Now, when they run MyMobileSpace on their mobile device, it'll ask for their login info. They get connected to your server, which looks up their MySpace userId based on that login info, and can then use that Id to request resources from the RESTful API -- all without ever having to actually log on to MySpace itself.

     

  • 04-09-2008 4:23 PM In reply to

    • Hristo
    • Not Ranked
    • Joined on 04-03-2008
    • Posts 4

    Re: Authentication in REST api

     Thanks. Sounds fine for me.

    I only will need some help to accomplish the second part, getting the user Id with the loggin data for MySpaceMobile. Do you have some example code that I can use? This part can be realesed with de JS API?

Page 1 of 1 (15 items)