How to download a Private gallery image

jiminyjiminy Registered Users Posts: 10 Big grins

I have oauth 1.0a functioning. I can get the list of galleries and images in a private gallery. However I cannot seem to actually GET an image from a private gallery. In my IOS app i am returned an authentication challenge. On the original GET request I have include the Authorization header with oauth_token, oauth_nonce, oauth_signature, oauth_consumer_key, oauth_timestamp, oauth_version, oauth_signature.

Am I missing something obvious? The fact that oauth works well enough to list the gallery contents is encouraging, but I don't understand what I am missing on the actual image download.
Galleries that are marked simply as unlisted download fine.

Any help appreciated.
Jim

Comments

  • jiminyjiminy Registered Users Posts: 10 Big grins

    Never mind, I figured it out. I had a small error in my Authorization header when attempting to download an image. Once I made a change to correct that problem it works fine. I think the authentication challenge was unrelated, and I just commented out the callback for that, allowing iOS to perform it's default processing. All it working now.

  • jiminyjiminy Registered Users Posts: 10 Big grins

    Just to be thorough here, I should point out that if you get redirected, you need to build a new NSURLRequest with the Authorization header again otherwise you will fail on a 404 error. In my case that meant handling the Delegate callback at willPerformHTTPRedirection, building a NSURLRequest object with the new redirected url and Authorization hdr, and then calling the completion function with the new request.

  • rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins

    Hi Jim,
    I'm glad to hear that you were able to figure this out and thanks so much for coming back with details on how you were able to resolve this. That's really useful in case someone else runs into the same situation.

    Sebastian
    SmugMug Support Hero
Sign In or Register to comment.