Welcome Developers!

in

Welcome!

in

validating app in an iframe using php

Last post 06-04-2009 10:35 AM by rondata. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 05-06-2009 2:01 PM

    validating app in an iframe using php

     hello to all.

     I have an application that I wrote in php5 which pulls information from a website that a user is registered to and displays his/her information from that site in the application.

     Now i need the application to be able to get information about the user (i.e. his friends (so that the user can invite his freinds to use the app) and other information as well).

    I am trying to authorize my application using the OAUTH and I am following the step by step instructions found here. http://wiki.developer.myspace.com/index.php?title=OAuth_REST_API_Usage_-_Authentication_Process

    I am using the official myspace php api library: myspace-da-php-download.

    Now every time i try to authorize the user right after "step 2:redirect to a myspace url to authenticate the user." I should be getting back a new parameter called oauth_token.

    However my query string always mentions that i have an error and that:  External Domain o oauth_callback uri is not set.

    This is the full query string that I get back:

    oauth_problem=oauth_problem%253Dparameter_rejected%252C%2520oauth_parameters_rejected%253DExternal%252520Domain%26oauth_problem_advice%253D%255BExternal%2520Domain%255D%2520or%2520%255Boauth_callback%255D%2520uri%2520is%2520not%2520set.

    Here is my php code:

     $myspace = new MySpaceAPI($consumer_key,$consumer_secret);
      $requestToken = $myspace->OAuthToken->get_request_token();
      $tokens = array();
      $requestTokenArray = explode('&',$requestToken);
             for($i = 0; $i < count($requestTokenArray); $i++){
                   $tokens[$i] = explode('=',$requestTokenArray[$i]);
                   }
                    $oauth_token = $tokens[0][1];
                    $oauth_token_secret = $tokens[1][1];
                    $url=$myspace->OAuthToken->get_authorization_url("http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=133049", $oauth_token);

    header ("Location: " . $url);

     

    any help would greatly appreciated.

    thank you in advance!              


     

  • 05-07-2009 10:39 AM In reply to

    Re: validating app in an iframe using php

    Have you looked at our SDKs?

    http://wiki.developer.myspace.com/index.php?title=Category:MySpaceID_SDK

     

    (I know this says they're for MySpaceID but you should be able to use for both.)

  • 05-07-2009 10:47 AM In reply to

    Re: validating app in an iframe using php

     Thank you very much..

    I will try to use this.

    I have been trying all sorts of things which is why I am posting all over the place Smile.

    appreciate your help.

    I will try this now and hope for the best.

  • 05-07-2009 10:59 AM In reply to

    Re: validating app in an iframe using php

     hey rondata,

    I was looking around the myspace sdk for php and it gave some pretty simple and understandable examples. I am just confused as to why my code was not working. I followed the instructions step by step but my application just would not authorize. 

     

    thanks

  • 05-07-2009 1:17 PM In reply to

    Re: validating app in an iframe using php

    I wonder if this has anything to do with it being Iframe

    Let me check in. I'll get back to ya

  • 05-07-2009 1:48 PM In reply to

    Re: validating app in an iframe using php

     also just one more question (sorry to bother you so much lol)

     

    which php library to you recommend I use: myspacel_php5_20080317 or myspace-da-php-download (the one that is currently available for download on the myspace site). the reason i am asking is because when i download the one that is currently available (myspace-da-php-download)it tells me to test it using: MSAPI-TestAllGets.php MSAPI-TestAllPosts.php and OSAPI-TestAllGets.ph.

    however these files are only available with the other release: myspacel_php5_20080317.

    Also with the myspacel_php5_20080317 i actually get access to some features (such as friends) but with the other php library absolutly everything errors.

    Once again thank you for your time

     

  • 05-11-2009 7:33 AM In reply to

    Re: validating app in an iframe using php

     Everything you need should be in the SDK.

    Rhonda

     

  • 06-03-2009 9:05 PM In reply to

    • Tapos
    • Not Ranked
    • Joined on 07-31-2008
    • Posts 1

    Re: validating app in an iframe using php

     Hi Rhonda,

     thanks for your helps. 

    I am kinda struglling to get the oauth_token.

    I have tried in many ways, also with your reffered SDK but no luck.

    its always saying 

    'oauth_problem%3Dparameter_rejected%2C%20oauth_parameters_rejected%3DExternal%2520Domain&oauth_problem_advice%3DEl%20uri%20de%20%5BExternal%20Domain%5D%20o%20%5Boauth_callback%5D%20no%20est%C3%A1%20programado.

     can you pls help me by addressing, what i am doing wrong?

     Thanks again for your great help.

     

  • 06-04-2009 10:35 AM In reply to

    Re: validating app in an iframe using php

    Hey there, sorry for the delay in responding. The fact that we're switching everyone to use the SDKs has shown to have some problems as we do not have a demo out for it yet. We're also working on documentation around it. Let me see if I can check in re: this particular error.

    Rhonda

     

Page 1 of 1 (9 items)