0

Can not get Request token using the PHP SDK

Hi all,

I tested the OAuth using the PHP SDK, but the YahooSession::requireSession() always return null.

When I examined the result of each request, I saw that I could not get the request token at https://api.login.yahoo.com/oauth/v2/get_request_token

The error was: 400 Bad Request - This application cannot make authentication requests on user's behalf.

Please tell me what happened.

Thanks!

by
6 Replies
  • Hi Anh,

    Usually when i was having those problems it was due to a slight copy/paste issue with my application keys. I would start off making sure that those are 100% correct. Next, you may want to use one of our base examples such as on: http://developer.yahoo.com/social/sdk/. If you are still experiencing issues, we can try to give you some more code specific help to get you up and running

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network

    QUOTE (Anh Khoa @ Nov 12 2008, 08:09 PM) <{POST_SNAPBACK}>
    Hi all,

    I tested the OAuth using the PHP SDK, but the YahooSession::requireSession() always return null.

    When I examined the result of each request, I saw that I could not get the request token at https://api.login.yahoo.com/oauth/v2/get_request_token

    The error was: 400 Bad Request - This application cannot make authentication requests on user's behalf.

    Please tell me what happened.

    Thanks!
    0
  • QUOTE (Jon @ Nov 13 2008, 02:09 PM) <{POST_SNAPBACK}>
    Hi Anh,

    Usually when i was having those problems it was due to a slight copy/paste issue with my application keys. I would start off making sure that those are 100% correct. Next, you may want to use one of our base examples such as on: http://developer.yahoo.com/social/sdk/. If you are still experiencing issues, we can try to give you some more code specific help to get you up and running

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network

    Hi Jon,

    You are right, when I copied my key, I double clicked the field, and the two minus at the end of the key was not copied.
    However, the error above was because I created another application and forgot to set the scope.

    Anyway, it is working fine now.

    Thank you very much!
    Khoa.
    0
  • QUOTE (Jon @ Nov 13 2008, 02:09 PM) <{POST_SNAPBACK}>
    Hi Anh,

    Usually when i was having those problems it was due to a slight copy/paste issue with my application keys. I would start off making sure that those are 100% correct. Next, you may want to use one of our base examples such as on: http://developer.yahoo.com/social/sdk/. If you are still experiencing issues, we can try to give you some more code specific help to get you up and running

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network


    Hi Jon,

    I'm trying to get 'sampleapp.php' script run in my devel machine. I placed all right key values for consumerKey, consumerKeySecret and applicationId, but still returns null session value, and apache log says '400 bad request', 'This application cannot make authentication requests on user's behalf.'.

    What other things I can try to get this up in my box?
    0
  • QUOTE (Hyo Soo @ Jan 12 2009, 01:37 AM) <{POST_SNAPBACK}>
    Hi Jon,

    I'm trying to get 'sampleapp.php' script run in my devel machine. I placed all right key values for consumerKey, consumerKeySecret and applicationId, but still returns null session value, and apache log says '400 bad request', 'This application cannot make authentication requests on user's behalf.'.

    What other things I can try to get this up in my box?


    This problem was fixed after I set access scope.

    Thanks,
    Hyosoo
    0
  • QUOTE (Hyo Soo @ Jan 12 2009, 09:11 PM) <{POST_SNAPBACK}>
    This problem was fixed after I set access scope.

    Thanks,
    Hyosoo



    Hello,

    I am having the same problem as Hyosoo reported. I am a first time user of the PHP SDK. I installed it and got the API keys. I am trying the sample program that is on the Yahoo! developer website for OAuth. I pasted in all the keys (API, Secret, Application). I get the same error at the same point in the sample script. I see that Hyosoo fixed his problem by setting access scope, but I don't know what that means (I am a novice).

    Andrew
    0
  • QUOTE (fashionsdotorg @ Feb 13 2009, 03:27 PM) <{POST_SNAPBACK}>
    Hello,

    I am having the same problem as Hyosoo reported. I am a first time user of the PHP SDK. I installed it and got the API keys. I am trying the sample program that is on the Yahoo! developer website for OAuth. I pasted in all the keys (API, Secret, Application). I get the same error at the same point in the sample script. I see that Hyosoo fixed his problem by setting access scope, but I don't know what that means (I am a novice).

    Andrew


    I figured out my problem. The Yahoo page for New Application is a little funky where you specify access scope. I checked off some of the fields under the private access, but did not check the private access box itself. Sigh, pilot error. It would be nice if the private access settings were disabled until you select the private access box checkbox.
    0
  • Hello,

    I am having the same problem as Hyosoo reported. I see that Hyosoo and none fixed this problem by setting access scope. I did all the setting but still unable to solve this problem.

    What other things I can try to get this up in my box?

    0

Recent Posts

in OAuth General Discussion YDN SDKs