0

Signature Error For Requests with ';' in the URL

I am using the sports api for my fantasy baseball league, and all the requests work find except for those that have ; in the url. For these yahoo returns:

<?xml version="1.0" encoding="UTF-8" ?>
- <yahoo:error xmlns:yahoo="http://yahooapis.com/v1/base.rng" xml:lang="en-US">
<yahoo:description>Please provide valid credentials. OAuth oauth_problem="signature_invalid", realm="yahooapis.com"</yahoo:description>
</yahoo:error>
- <!-- fan247.sports.ac4.yahoo.com uncompressed/chunked Mon Apr 11 09:55:13 PDT 2011
-->

I am using oauth2 and python so it could be a problem with the client. Any help would be appreciated.

by
2 Replies
  • I played around a little and was able to fix the problem by adding a '/' to the end of the URL. I don't know if this "fixed" the problem in the python oauth2 client or on the yahoo server side.

    So I simply added a / to the end of the url: http://fantasysports.yahooapis.com/fantasy...oreboard;week=1/

    QUOTE (Mike @ Apr 11 2011, 09:02 AM) <{POST_SNAPBACK}>
    I am using the sports api for my fantasy baseball league, and all the requests work find except for those that have ; in the url. For these yahoo returns:

    <?xml version="1.0" encoding="UTF-8" ?>
    - <yahoo:error xmlns:yahoo="http://yahooapis.com/v1/base.rng" xml:lang="en-US">
    <yahoo:description>Please provide valid credentials. OAuth oauth_problem="signature_invalid", realm="yahooapis.com"</yahoo:description>
    </yahoo:error>
    - <!-- fan247.sports.ac4.yahoo.com uncompressed/chunked Mon Apr 11 09:55:13 PDT 2011
    -->

    I am using oauth2 and python so it could be a problem with the client. Any help would be appreciated.
    0
  • QUOTE (Mike @ Apr 11 2011, 09:39 AM) <{POST_SNAPBACK}>
    I played around a little and was able to fix the problem by adding a '/' to the end of the URL. I don't know if this "fixed" the problem in the python oauth2 client or on the yahoo server side.

    So I simply added a / to the end of the url: http://fantasysports.yahooapis.com/fantasy...oreboard;week=1/

    I've seen a few other people complaining that other OAuth clients did the same thing and interpreted anything near a semicolon as a URL parameter instead of part of the URL itself, so it's great that you found a workaround of adding a slash to the end -- I think that should work in most cases. It's also possible that URL encoding the semicolon would help, too, but I'm not positive.

    (the problem is on the client side, I believe, as we have no problem accepting signatures for URLs with semicolons as long as the signature is generated while keeping the parameters around the semicolon as part of the URL that you're signing, instead of moving them into the parameter section of what's being signed [under the covers, OAuth divides the base URL and the parameters on the URL into different sections of your base signature string])
    0

Recent Posts

in Fantasy Sports API