0

oauth_authorization_expires_in is Time.now

When refreshing the access_token, I'm getting a response with oauth_authorization_expires_in set to the current time, not when it should be expiring. Why is that?

by
4 Replies
  • Hi Koden,

    Can you please provide the complete HTTP request and response headers
    so we can check where it may go wrong?

    Thanks,
    Yu Wang
    Yahoo! Membership Team
    0
  • QUOTE (omiga @ Sep 3 2010, 10:02 AM) <{POST_SNAPBACK}>
    Hi Koden,

    Can you please provide the complete HTTP request and response headers
    so we can check where it may go wrong?

    Thanks,
    Yu Wang
    Yahoo! Membership Team


    Nothing in the request headers, since it's just a query string:
    https://api.login.yahoo.com/oauth/v2/get_token?oauth_consumer_key=dj0yJmk9eXU4dk1DcGxwUkl6JmQ9WVdrOWRIbEpOV3RtTTJVbWNHbzlPVFU1T
    kRJNU16WXkmcz1jb25zdW1lcnNlY3JldCZ4PTMx&oauth_nonce=1283542729fanvibe&oauth_session_handle=AGkRWUwMquFafMFkHCOX3Aa89ofMZAPTHkUxFuIEbdI3NrYwggC8q4M-&oauth_signature=b95bd5100d036a986725c3fdf6455f4b6ecc07be%26c6923a148c9a45ee40d783877dfac21409a22af2&oauth_signature_method=PLAINTEXT&oauth_timestamp=1283542729&oauth_token=A%3DNEAom5HimQQ_tHE2XjBDNX7rmJU3RUO92JNXk9RcLZxt9q_caEN2Aqqnu.QnvMy6adDBruo484DUqb
    eLIdZENoODouwbvU4FYUBdNFKXgNVf.GglByVNxrvQqpOxKj1qz271.eJbpnIIvr5ncr0BA__FYLC1kzr
    xEEcWMb4tnj1SKXUMmWqJY4KtvMw5RBzRF2dfwEkpNsX8OyMLjXicS2auztwLhR_YXK20FCrGBrcyvLnq
    zOqw29CS5jqa_gqu4ro43NhOSd8zBdyF5T9yruS9qmM1vXnUShBTOo89q5VJK82lvUb9UgBirmWmZm_nN
    JjK5VVU2qCCISbBSXSXVrbB1HoLoIhb.tQVlsBL0qSQMbLLDo7kdGwS0iREP6rOBj.7.YXSsRYLkfPOIk
    GnZLBDYK9kMT1Q.JD_3Rx3a2BF1AKVtrDFJgm05szFzWe2dSxYn3wxQSpmechjsSkh6r.r7IzanNJGxaV
    MefCihzYELn3N43ETp.HPYdJFXMsHHAOMLZjKKFlWYHIm8YtXoNfv32Wbz0TegsZHnwNSwy8EtfhDA5Ck
    S4wqrMneoDJRRjLhxoysCC7YsQ9bii._L1wgpjgNnXzuhvEWSm7Iu.fypd5EBPJWFa6wGh9nu38FY6Rro
    b08NmOEyTL.nOocE8VC3O5jnHIhv40o4hfN7A3ljJfW5Hs7qt6dWaCApOF5DBjNxFvXv4Sm2kEFkEvUl0
    gbeKFetRLyYaeYu7l9ny0UlZ8duiNIGCazBJuyhrVVPs3PVuDoJ2vkxXTUuObu4zIe&oauth_version=1.0


    Here is the response header in YAML:
    args:
    :url: https://api.login.yahoo.com/oauth/v2/get_to...uth_version=1.0
    :headers: {}

    :method: :get
    body: oauth_token=A%3DcOQTgnfFtSa4dSM1.9fFmIdz1F83b6BAqgl8EBbhswVFWc7YAQsLYR62pFQm7h6VbArKp1vaUr5Hgx
    pleODFDo71m7IjXu1s1VmFF1OhOriBE.swAXeNnCaiTtbTuuRwwnb5mFa9YQyQ0jj0wMSYEeDPTYV3fMH
    v37VU1lrz.gb8IW6ESpqw9iftPnMgNDLmSyYyzwByq6E3GBe6KYPRjew6a8PU4iSoVtmZ3wUVgune4x.2
    BqCb6GEtTHR0KYVoHFTcn4wVPvDFl4MjBlVj3J9XVDy8ykYxNwgWilTiEl8eCD09tlRip_tbX6CTJWK5d
    N7wJB9hnd8kJYtjs9KLJSdeRMgXKg9FzaDacqNUrdDYyg7GuxfqgMTwFZRpFjpHTIM2mssnKULk.56uBa
    XffLT4tDuDprbo8fRFZxc_iyK4q8eiWsPHkTHNHMO_hhUg7TlHWYj.VFPgm9nkT.HFEGUlABM95t6U3G8
    R7.83Tu8pdBzjifGvvzvMuaCNxavmvzZolKHskQpg.RCuEUv1ctwXivW.z6AqjCr.vkrY2UBpw4apC6wE
    ahAy3fFpJ6HYMlqqMwvLOHCclfDkes_Ie0P_32a3KS_LKybK5WyWaTCrG32ukFuUOyTWaox71FERzmonh
    GDPV9PUvEktWms5UR83f6BHC57PW8gAfSGF8uJ5BLb0j2h.G35M9yHFnuMBR.kNXoVaXndQcdn5fbDolW
    LJDrJ1O9nDwylf6TRiNVS9nl4cPfKxiKEp9ewB7jsnVqdrEZgbSd1aujHavdvTYIRW&oauth_token_secret=2cf72619bdde8c2ad080a5ec948f9d8b70e9d934&oauth_expires_in=3600&oauth_session_handle=AGkRWUwMquFafMFkHCOX3Aa89ofMZAPTHkUxFuIEbdI3NrYwggC8q4M-&oauth_authorization_expires_in=863940889&xoauth_yahoo_guid=2RQDF6QC7IE6EK3LCR7UQWRK3A
    net_http_res: !ruby/object:Net::HTTPOK
    body: oauth_token=A%3DcOQTgnfFtSa4dSM1.9fFmIdz1F83b6BAqgl8EBbhswVFWc7YAQsLYR62pFQm7h6VbArKp1vaUr5Hgx
    pleODFDo71m7IjXu1s1VmFF1OhOriBE.swAXeNnCaiTtbTuuRwwnb5mFa9YQyQ0jj0wMSYEeDPTYV3fMH
    v37VU1lrz.gb8IW6ESpqw9iftPnMgNDLmSyYyzwByq6E3GBe6KYPRjew6a8PU4iSoVtmZ3wUVgune4x.2
    BqCb6GEtTHR0KYVoHFTcn4wVPvDFl4MjBlVj3J9XVDy8ykYxNwgWilTiEl8eCD09tlRip_tbX6CTJWK5d
    N7wJB9hnd8kJYtjs9KLJSdeRMgXKg9FzaDacqNUrdDYyg7GuxfqgMTwFZRpFjpHTIM2mssnKULk.56uBa
    XffLT4tDuDprbo8fRFZxc_iyK4q8eiWsPHkTHNHMO_hhUg7TlHWYj.VFPgm9nkT.HFEGUlABM95t6U3G8
    R7.83Tu8pdBzjifGvvzvMuaCNxavmvzZolKHskQpg.RCuEUv1ctwXivW.z6AqjCr.vkrY2UBpw4apC6wE
    ahAy3fFpJ6HYMlqqMwvLOHCclfDkes_Ie0P_32a3KS_LKybK5WyWaTCrG32ukFuUOyTWaox71FERzmonh
    GDPV9PUvEktWms5UR83f6BHC57PW8gAfSGF8uJ5BLb0j2h.G35M9yHFnuMBR.kNXoVaXndQcdn5fbDolW
    LJDrJ1O9nDwylf6TRiNVS9nl4cPfKxiKEp9ewB7jsnVqdrEZgbSd1aujHavdvTYIRW&oauth_token_secret=2cf72619bdde8c2ad080a5ec948f9d8b70e9d934&oauth_expires_in=3600&oauth_session_handle=AGkRWUwMquFafMFkHCOX3Aa89ofMZAPTHkUxFuIEbdI3NrYwggC8q4M-&oauth_authorization_expires_in=863940889&xoauth_yahoo_guid=2RQDF6QC7IE6EK3LCR7UQWRK3A
    body_exist: true
    code: "200"
    header:
    p3p:
    - policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
    content-type:
    - text/plain; charset=utf-8
    connection:
    - close
    date:
    - Fri, 03 Sep 2010 19:39:18 GMT
    transfer-encoding:
    - chunked
    http_version: "1.1"
    message: OK
    read: true
    socket:
    0
  • what I've done is added the oauth_authorization_expires_in and the oauth_expires_in times together, and that seems to work. I'm not sure what the oauth_authorization_expires_in parameter should return though, but combining the two seems to be ok for me at the moment. Is this what I should do?

    I'm only refreshing the token if the expiration time is within 2 minutes of expiring.
    0
  • Hi koden,

    It looks like the oauth_session_handle is already invalid. Can
    you please reproduce this problem with a test Yahoo! account and
    then send the request/response headers?

    Thanks,
    Yu Wang
    0

Recent Posts

in OAuth General Discussion YDN SDKs