FlickrNet.Exceptions.InvalidSignatureException: Invalid Signature (96)

Topics: Developer Forum
Jun 27, 2012 at 7:15 PM

I am getting this error message on some searches. When going into flickr.com and performing the same search there is no issue. I thought maybe the tag or string I searched on might have been gone or the search didn't return any result, but that is not the case. 

I am using Silverlight 5 and the FlickrNet Silverlight API.

Thanks

 

--tolga

Coordinator
Jun 27, 2012 at 8:16 PM

Well what are you searching for exactly?

Jun 28, 2012 at 1:19 AM
Edited Jun 28, 2012 at 1:24 AM

I am searching for images. I have a Client (Silverlight) application where I list the user's tags on the left and display found images on the right. The search works for about 98% of the tags, but for the ones in question I get this "Invalid Signature (96)" error.

One of the tags that causes this error is "shower" for example.

Here is my code

 

  PhotoSearchOptions searchOptions = new PhotoSearchOptions();
                searchOptions.Tags = sSelectedTag;
                searchOptions.Extras = PhotoSearchExtras.All;
                if (this.CurrentConditionOperator == "And")
                    searchOptions.TagMode = TagMode.AllTags;
                else
                    searchOptions.TagMode = TagMode.AnyTag;

                searchOptions.UserId = Const.FlickrUserId;
                searchOptions.SortOrder = PhotoSearchSortOrder.DatePostedDescending;
                searchOptions.PerPage = 1000;

                this.Images.Clear();

                this.flickrNet.PhotosSearchAsync(searchOptions, e =>
                {
                    this.dispatcher.BeginInvoke(() =>
                   {
                       this.ShowSearchPrompt = Visibility.Collapsed;
                       this.IsBusy = false;

                       if (e.Result.Count > 0)
                       {

                           foreach (var item in e.Result)
                           {
                               UIFlickrImage uiFlickrImage = new UIFlickrImage();
                               uiFlickrImage.ImageTitle = item.Title;
                               uiFlickrImage.Url = item.SmallUrl;
                               uiFlickrImage.LargeUrl = item.LargeUrl;
                               uiFlickrImage.ImageSelectedForDownload = false;
                               uiFlickrImage.ImageWidth = Convert.ToInt32(item.LargeWidth);
                               uiFlickrImage.ImageHeight = Convert.ToInt32(item.LargeHeight);

                               if (uiFlickrImage.ImageHeight > uiFlickrImage.ImageWidth)
                                   uiFlickrImage.Orientation = "Portrait";
                               else
                                   uiFlickrImage.Orientation = "Landscape";


                               uiFlickrImage.SmallUrlHeight = 152;
                               uiFlickrImage.SmallUrlWidth = 152;
                               uiFlickrImage.Tags = new ObservableCollection<string>(item.Tags);
                               if (uiFlickrImage.Tags.Contains(this.HOTELREFERENCEDEFAULTTAG.ToLower()))
                                   uiFlickrImage.Tags.Remove(this.HOTELREFERENCEDEFAULTTAG.ToLower());

                               uiFlickrImage.PhotoId = item.PhotoId;


                               uiFlickrImage.SelectionChanged += new EventHandler(uiFlickrImage_SelectionChanged);

                               this.Images.Add(uiFlickrImage);
                           }

                           this.Images = new ObservableCollection<UIFlickrImage>(this.Images.OrderBy(p => p.PhotoId));
                       }
                       else
                       {
                           this.SearchPromptText = "No items found";
                           this.ShowSearchPrompt = Visibility.Visible;
                       }

                   });

                });
Coordinator
Jun 28, 2012 at 7:38 AM
Edited Jun 28, 2012 at 7:39 AM

Thanks. That is how you are searching, but what I asked for was what you are searching for, i.e. what specific tags are you searching for that are producing the invalid signature exception.

Update: Sorry, I've just noticed you included "shower". Could you provide some more, along with some examples of tags which work please.

Sam

Jun 28, 2012 at 6:29 PM

Sure..

 

Tags that DO work

"Big Hotel"

"Blackberry Farm"

"Germany"

"Test Test"

"sink"

"bath"

Tags that DO NOT work:

"shower"

"discus"

"asdfsd"

 --thanks


Coordinator
Jun 30, 2012 at 7:00 PM

No, not able to reproduce.

Are you using the new OAuth stuff, rather than the old auth methods?

Could you supply me with the code which creates and Flickr instance, and the user ID you are using?

Jun 30, 2012 at 11:56 PM

I am not sure about the OAuth stuff. I am using the FlickrNetSilverlight assembly version v2.0.50727

This is how I instantiate the FlickrNet object.

 

this.flickrNet = new Flickr(Const.ApiKey, Const.SharedSecret);               

this.flickrNet.AuthToken = Const.AuthToken;

Then this is how I perform the search

PhotoSearchOptions searchOptions = new PhotoSearchOptions();               

searchOptions.Tags = "shower";               

searchOptions.Extras = PhotoSearchExtras.All;                       

searchOptions.TagMode = TagMode.AllTags;               

searchOptions.UserId = Const.FlickrUserId;               

searchOptions.SortOrder = PhotoSearchSortOrder.DatePostedDescending;               

searchOptions.PerPage = 1000;

 

this.flickrNet.PhotosSearchAsync(searchOptions, e =>

{

...

});

 

My flickr userId is 31793920@N05

 

Thanks

Coordinator
Jul 1, 2012 at 8:23 PM

Sorry, I've tried to reproduce as closely as possible at my end but with no luck. I only see about 5 photos in your photostream however, so when I search it always returns no results (none of the photos there have any tags).

Oh, and I believe what you have quoted is the runtime version (i.e. which version of .Net) not the version of the silverlight DLL.

Sam

Jul 1, 2012 at 10:38 PM

Hi:

I just realized I have you the wrong FlickrId. Here is the one with the "shower" tag. 

43302351@N03

The FlickrNetSilverlight assembly version is 3.4.0.0. Would like me to send you my code in an email so you can see exactly what is happening?

 

Coordinator
Jul 2, 2012 at 8:26 AM

Yeah, still not seeing any issues I'm afraid. I'm also not seeing any tagged photos for that user id.

If you wanted to send me the code I could certainly have a look. Email sam@wackyabs.net

I'd specifically need the same api key, secret and auth token as you are using, as is the only thing that is still different. I realise if you don't want to supply me with them as this would obviously give me access to your account.

The only other thing that springs to mind is are you using a different language from English as your default?

Sam

Coordinator
Jul 2, 2012 at 12:12 PM

Actually, just has a thought. You're not using Safari are you? If so there is an issue with Safari. Check out this issue report here: http://flickrnet.codeplex.com/workitem/30243

Try inserting the following before you call to Flickr:

bool httpResult = WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
Sam

Jul 2, 2012 at 4:28 PM

No, I am using IE and Chrome and in browers I get the error.

I will send you a slimmed down version of my application with all the keys.

Thanks

--tolga

Jul 2, 2012 at 4:50 PM

I build a little app and now I can't reproduce the issue from the main app ;(. The tags that were causing the issue are also gone. Not sure what is going on, but things seem to work now. Sorry for all the inconvenience. I will keep an eye on this. If I see the issue again I will just email you the simple app.

thanks