Invalid signature error using smugmug.subcategories.create

PreranaPrerana Registered Users Posts: 7 Beginner grinner
Hello All,

I am trying to create subcategory inside "Others" Category of SmugMug using API 1.3.0. Its throwing me "Invalid Signature" error. I am using the same method of signing for other request which gets executed successfully. Now I am unable to figure it out where I am going wrong!:dunno

This is my request url
Here is my Base String :-
GET&https%3A%2F%2Fapi.smugmug.com%2Fservices%2Fapi%2Frest%2F1.3.0%2F&CategoryID%3D45663115%26method%3Dsmugmug.subcategories.create%26Name%3Dprerana%26oauth_consumer_key%3D1WcKTxQH2fegQTF0C7cVAORjeoTSD68V%26oauth_nonce%3D2379299%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1415859474%26oauth_token%3Dc5c2612d398c0c26c443c2aa53733b08%26oauth_version%3D1.0

Here is my actual api call along with signature :-

This is error what I get after executing it :-
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="fail"><method>smugmug.subcategories.create</method><err code="35" msg="invalid signature"/></rsp>

I am completely at my wits end on this issue and unable to track it down. My app production has hit a roadblock because of it:cry

Any help or pointers will be great. Thanks a ton in advance!

-Prerana

Comments

  • ktvoelkerktvoelker Registered Users Posts: 25 Big grins
    edited November 13, 2014
    It appears that your parameter normalization routine is not sorting the parameters correctly.

    Section 3.4.1.3.2 of RFC 5849 says "The parameters are sorted by name, using ascending byte value ordering." All uppercase letters have lower byte values than the lowercase letters, which means that the Name parameter should come before the method parameter.
    Karl Voelker
    Sorcerer and API Guy at SmugMug
  • PreranaPrerana Registered Users Posts: 7 Beginner grinner
    edited November 14, 2014
    Hey Karl,
    Thanks a ton for your response. Yes that is the root of the issue. But now the biggest issue is I am using the same library(OAuthBase) for generating signatures and signing requests for remaining SmugMug calls for example "Creating Gallery" and it is getting executed correctly and fetching the results too! Here is my request url,normalised parameter and base string for Creating Gallery and its getting executed successfully :-
    Protected=True&Public=False&Searchable=False&Title=22_9_2014%2Fchild2folder&method=smugmug.albums.create&oauth_consumer_key=1WcKTxQH2feckbjck0C7cVAORjeoTSD68V&oauth_nonce=6408980&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1415946823&oauth_token=c5c2612d39ncmnb443c2aa53733b08&oauth_version=1.0
    GET&https%3A%2F%2Fsecure.smugmug.com%2Fservices%2Fapi%2Frest%2F1.3.0%2F&Protected%3DTrue%26Public%3DFalse%26Searchable%3DFalse%26Title%3D22_9_2014%252Fchild2folder%26method%3Dsmugmug.albums.create%26oauth_consumer_key%3D1WcKTxQH2feggdjgjAORjeoTSD68V%26oauth_nonce%3D6408980%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1415946823%26oauth_token%3Dc5c2612d39dbfghdc443c2aa53733b08%26oauth_version%3D1.0

    Now I am going completely crazy wondering why such behaviour only with this Api call (smugmug.subcategories.create) and not with others!! Do you think it might have got to do something with sequence in which I am passing parameters in request url ? I tried permutation and combination there too but no luck :(
  • PreranaPrerana Registered Users Posts: 7 Beginner grinner
    edited November 17, 2014
    Hi there,
    Any update on this? Can any one who have successfully used this api call (smugmug.subcategories.create) post a code snippet for my reference? I have been trying to fix this since 3 days now but no result :( All the remaining api calls get sorted correctly except this!!.. Any any help will be highly appreciated!! Thanks a ton in advance.
  • ktvoelkerktvoelker Registered Users Posts: 25 Big grins
    edited November 17, 2014
    Since the problem appears to be caused by OAuthBase, perhaps there is a forum or mailing list for that library where you can ask for help.
    Karl Voelker
    Sorcerer and API Guy at SmugMug
Sign In or Register to comment.