AlexGhiondea / SmugMug.NET

This contains a C# object model over the SmugMug API.
MIT License
8 stars 2 forks source link

Help accessing a public site that has a locked gallery #25

Open ricknegrin opened 8 years ago

ricknegrin commented 8 years ago

I am trying to access a SmugMug site that is open to the public (so there is no need to authenticate) but has a gallery that is locked with a password. Is there a way to access that using SmugMug.NET? It looks like the site object is tied to a user object. Any help would be appreciated. Thanks.

AlexGhiondea commented 8 years ago

That is a great question. I thought you could authenticate without a password, but I guess that was deprecated by the move to oAuth.

At this time, the only think I can think of is trying to login with any account and then try to access the password protected album.

ricknegrin commented 8 years ago

Alex,

Thanks for responding. I am not sure what you mean. The object model only allows me to get albums based on my account (i.e. the user object returned from the Login function on the Site object). How can I specify a specific site that is not the one bound to my user? I have been going through the code and I don't see a way to do that. (BTW, I found a parameter for the site password in the GetAlbums override function, so that seems promsing. I just have to figure out how to reference the site/Album I want.

AlexGhiondea commented 8 years ago

You are correct -- there is no good way to get to the album if the album is not yours and password protected :(.

The only thing I can think of is trying to make the request yourself.

You can either try and re-use the CommunicationHelper class and write a method that will access any random album, or try to write this at the HttpClient level with a GET request. You can inspect the SmugMug APIs here: http://api.smugmug.com/api/v2.

ricknegrin commented 8 years ago

I see. Thank you for the help.