0

Problems with Meseenger IM SDK Notifications (Comet style)

Hi all,

I'm trying to make the notifications system work in my Android app but every time when 
I start a long-lived connection, the server responds imediatly with "bad IM cookie or URI credentials"

This is my request:

POST  http://rproxy2.messenger.yahooapis.com /v1/pushchannel/my_user_id ?sid=4AVIQy7s3BjXAh34slw0AvKx4LnT3XW0cQE-
&rand=-2045612030
&count=10
&seq=0
&format=json
&IM=25HKmWWedVOgeZtifAJEq7rBYENuipCHhaMjPe9FGK_rZspwGZeIc39vxBmY9z6z2BFuc1CNqwxmPL1M-|4QhLeW9C80jvBSMNd62Dvg--&oauth_consumer_key=dj0yJmk9cFNKb2NKbTdINEtFJmQ9WVdrOVpHMW1aVXhKTjJNbWNHbzlNamcyTnpNMU1UWXkmcz1jb25zdW1lcnNlY3JldCZ4PWJh
&oauth_nonce=a15ba5c9f8c249ac92cbe4a19b00af19
&oauth_signature_method=PLAINTEXT
&oauth_timestamp=1328093921690
&oauth_token=A%3Dajho_jDZjx7AhrapeDDUeE4EM8PHuHyJcXUl097VEC2QqRzEI3GD9rcMCxIMo2WSlMYtpPgP2cd4djNcxWSU4oux6w4K55tfpUCcjnifH9MdiEcA3TiJq1risO6zUL_.2cC4T34mYQu70yuko0urUFexNh0v6UZRMSH68qk_X_dRF4C6mneHOPrmqs6XGl7QgqM88oTjYUh2F314RNpWs0eeeMyVRGPY_m4kRpGZ4L0vMOhS6AcGdu.PzDOnEI2lpOSmvlAjkwrRU8_oR3Fb7lrm.2JzlV0i61LNQeFacRbLwyoxYgj6Xo1HF1NHKxSSknA3AUS6evzjR.GAKtdOmmnpOTRnNjWld_P3reoKWPwSMtcReF3W4nadjQgMW645lG3d1i3F7Nva1hXpZSMnT0LqcSdPI1iIXHT7qkiBx77AZATWEgffQyzqxo8_3C_LzfgjNmVwGuLbZHfdlcn.TVCdfJXUmIa9RkkzdjwL0n6FS.BIFCDEC2QdUpLgatI_qCIQLUKVA3xw6DXtUlisg3QdD4M_NAwDVV8PjpgGwKStF8lVs6UYnKWQvLMkBsDiNUm.MJIhNgthtWOkk2lTNfZyyhj4x3WZRoLgdERXwevmqBgn2Qk8_ZoWSQLDySPOT1OCA1KrmcQkchHJEY2DHbfMtGBxQvDryBbFBMpwFNooa3pkiC6u5qeDyhgtwfMD.dMEsIQrqmhUYewY
&oauth_version=1.0
&oauth_signature=2cd720831677df11508571218aed6c36c9cf2b51%269539a7f74aef35be5dd0caecafad4eb470d33792

HTTP/1.1 connection: keep-alive cookie: IM=25HKmWWedVOgeZtifAJEq7rBYENuipCHhaMjPe9FGK_rZspwGZeIc39vxBmY9z6z2BFuc1CNqwxmPL1M-|4QhLeW9C80jvBSMNd62Dvg-- User-Agent: Dalvik/1.2.0 (Linux; U; Android 2.2; sdk Build/FRF91) Host: rproxy2.messenger.yahooapis.com Content-Type: application/x-www-form-urlencoded Content-Length: 0

And the response is:

HTTP/1.1 403 bad IM cookie or URI credentials Connection: close

The IM cookie which is sent == IM cookie received from /v1/session?fieldsBuddyList=%2Bgroups¬ifyServerToken=1

Should I get the oauth tokens from notify server ( http://rproxy2.messenger.yahooapis.com ) ? Now I'm getting them from https://api.login.yahoo.com/oauth/v2/get_token?params.

Thank you.



4 Replies
  • Hey Liviu,

    Here is one of my (working) comet-style notification:

    "http://rproxy1.messenger.yahooapis.com/v1/pushchannel/my_user_id?
    oauth_consumer_key=dj0yJmk9cVhDRjdZZnJDRUJVJmQ9WVdrOWRUSlZNbVl4TjJVbWNHbzlORFExTlRZek9UWXkmcz1jb25zdW1lcnNlY3JldCZ4PTRm
    &oauth_nonce=754cfc37-c876-4862-9608-55f957a47acd
    &oauth_signature_method=PLAINTEXT
    &oauth_signature=ec85bb28eac9d806886fcb2185f79292645e8efd%2690990d4849181c6b602bf3632d375690b14ad3f9
    &oauth_timestamp=1328525305
    &oauth_token=A%3DpOJCUsnbp1zeN1k9YzBdEgJJC.ESJnMZ0BmJ.mY8.mP8CzWH9jx9OQ4vzqxc6ytja3l6uGlnwj1HT0XA54cvivIxuljm9.i23KI.juCWJReMMPf9YbcKEEo_xkvH1zWZFz8fX9kCnw1QXUoEKNlSQ0lErH9cHZMN1HbDdr1GCiRhRToRdDV8AJVE8KDxg7i3WqLY5_rqWHuSfDhD1owJQekitFmG1Y34cAS8BEz._uEurnwG9YC9iy0SBWHSIbCSWKATdqUD9x3xRs0Qe7vXDgdQa8TfSB6qvSI5AW5AckLSqf9i9Dq58phNV9XketNLg7xJqBp01eO72_dKy7ZqmaMzHv_8tgkCov1EdQ3KOS7bxvor2i7iLRRt2EVqpAOIvifDCQFzlTHSDPbtcsVPVNESWirlt84dLliH7XCmy60ARTdb58FBi75XbnAY2FXDorSMwiH2CA2gmryxzykicziQSXNymbdYeCNls098.KmJhTJ5a4atZFUAIRILxPpnD77G807UC2l4C2nGJA5X_hpn487a.W_.TXRGbCRVrwL9rzdBsNSpJWTp3t_1PhlvId_ChVARalqRgPAD2QzsKYS6KZZExCfHnH7FcRaWBc7_wsK.8O33YgvanvtrmJcwuXXciB9NWKZPPDpB5wE61dU69ghLgrvPcuhmRL.mF0rT6Bke9uWlZTdmSebZ99QzLQmxqy4_16GXNRzuPOnKC2Kl0mZSb6faHXjejzPoIivSFC01CHkV0g--
    &oauth_version=1.0
    &sid=WlIhvFns3BjENZ3TMib41fEvY1gmhl55viIpfQ--
    &seq=0
    &format=json
    &idle=30
    &rand=1401884658"

    Hope it helps!
    0
  • I have a shame problem to. but when I tried to loop this request. Sometime it have response, sometime it become 403 err. Any solution for this???
    0
  • I had the exact same problem. It turns out the error was caused by the HTTP requests library re-encoding my strings, so the IM token I was sending was wrong. For example, if the token were "A%5", it would get sent as "A%235", and it would trigger a 403 error. I don't know why it works some of the times and breaks some other time, but this fixed it for me. Try comparing the IM token your receive with the IM token you send. If you notice any differences, there's your problem. Hope this helps!
    0


  • QUOTE(Grewe @ 6 Aug 2012 5:25 AM)
    I had the exact same problem. It turns out the error was caused by the HTTP requests library re-encoding my strings, so the IM token I was sending was wrong. For example, if the token were "A%5", it would get sent as "A%235", and it would trigger a 403 error. I don't know why it works some of the times and breaks some other time, but this fixed it for me. Try comparing the IM token your receive with the IM token you send. If you notice any differences, there's your problem. Hope this helps!
    You sent IM via cookie or imtoken in URI :( I have just compared my url and imtoken , It extracly the same .
    0

Recent Posts

in Messenger IM SDK