• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #130 (Hot or Cold), Memol..

The next Dgrin Challenge DSS #131 (Music) is open for entries through June 24th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Old Nov-24-2004, 06:38 AM
#1
Nikolai is offline Nikolai OP
Darth SLR
Nikolai's Avatar
Cool2 API request: ping
I'm working on a smugmug-related app which is supposed to be a more than Fire-and-forget thing. Hence I need to know whether my sessionid is still valid. This will help to avoid the overhead of sending credentials over and over again and also reduce identity theft risk.
What I'm thinking about is a "ping" method which would send
  • String "SessionID"
  • String "UserID"
  • String "PasswordHash"
i.e. parameters acquired or used during login operation.

The response may either be simply success/fault one, or it can be more intelligent and in case this session has (recently?) expried, try to analyze the information provided and possbly issue a new set of credentials (which would again allow to skip a login).

Anyway, this would allow to keep client active and valid for as long as it is necessary.

What do you think?
Thanks!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Nov-25-2004, 10:58 AM
#2
luke_church is offline luke_church
#Grinner
Not so sure that it helps
Hi Nikolai,

Quote:

I'm working on a smugmug-related app which is supposed to be a more than Fire-and-forget thing. Hence I need to know whether my sessionid is still valid. This will help to avoid the overhead of sending credentials over and over again and also reduce identity theft risk.
I assue that you're using HTTPS communications, in which case to be honest if the HTTPS stack that you're using is properly engineered, I don't honestly think that it helps reduce ID theft. No-one is going to try and break an HTTPS connection to try and steal a smugmug account. Even with repeated transmission of the same information a HTTPS connection should be computationally infeasible to break.

So the only question remains is how to handle unencrypted connections. Firstly, I have grave doubts about the value of using unencrypted connections, in my opinion it would be superior to always attempt to reconnect over HTTPS and then transfer any information than it would be to try and hold a session open. In Smugmug's case, this is roughly equivalent to the relative complexity of engineering your own security protocol, versus using a pre-engineered one. Experience shows that the former will almost always be superior to the latter.

If HTTPS is not implemented on your target operating system (which judging on your thread on DPReview, seems extremely unlikely) then I think you're on a hiding to nothing trying to retrofit security. [Unless you're a security engineer ;)]

Quote:
What I'm thinking about is a "ping" method which would send

<DIR><DIR>String "SessionID"

String "UserID"

String "PasswordHash"

</DIR></DIR>i.e. parameters acquired or used during login operation.

The response may either be simply success/fault one, or it can be more intelligent and in case this session has (recently?) expried, try to analyze the information provided and possbly issue a new set of credentials (which would again allow to skip a login).
This is becoming more dangerous. There are many cases in security API design where it has been shown that the more sophisticated the security API the more difficult it is to secure properly. Hence security API's implemented in places where it really matters tend to be kept as simple as possible. This is general guidance, let me throw a few specific objections:

if you're frightened about people stealing the credentials because they're being used to much, you must be concerned about people snooping on the communications stream, if this is a genuine security problem then we must assume that an attacker could snoop on the communications stream of the ping requests.

We can then assert that the attacker could use this information to hold the connection open for longer than your application intends. If the attacker could use this information to fake requests, then you're attacker has all of the power of the available API is at his command.

So there may be solutions to this, using IP address tracking, using session key exchange etc... but all we are doing by adding such systems is increasing the complexity of the security system, okay so were no longer sending a potentially valuable password around, but we haven't really protected the APIs, all we've done is vastly increased the complexity of the required security system to achieve the same security. As indicated above with the general guidance on security APIs, this generally seems to mean that we have spent a lot of money making the system less secure.

On the face of it your suggestion sounded like a good idea, but one further reflection I'm not so sure that it is useful.

Quote:
What do you think?
that's just my two cents.

Keep up the good work as an ideas generator

Luke

[font=Arial][/font]
__________________
Photography: www.lukechurchphotography.com
SmugSoftware: www.smugtools.com
Old Nov-25-2004, 12:40 PM
#3
Nikolai is offline Nikolai OP
Darth SLR
Nikolai's Avatar
Luke,
Thank you very much for the detailed answer!
I think I inadvertedly shifted the focus of my own message towards the security/identity theft, to which, I agree, you have very valid points.
However, my primary reason for this request was simply trying to avoid "zomby client" effect and also avoid unnecessary relogins. I asked before about the "session logevity period", but unfortunately didn't get any answers.
So I was thinking of "ping" as a lightweight "are you there? I am here!" message, which would prevent session ID from expiration and allow the app to use it for a prolonged time interval without requesting a new one.

Thanks!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Nov-28-2004, 02:54 PM
#4
luke_church is offline luke_church
#Grinner
Ahhh OK
Hi Nikolai,
Quote:
Originally Posted by Nikolai
However, my primary reason for this request was simply trying to avoid "zomby client" effect and also avoid unnecessary relogins. I asked before about the "session logevity period", but unfortunately didn't get any answers.
So I was thinking of "ping" as a lightweight "are you there? I am here!" message, which would prevent session ID from expiration and allow the app to use it for a prolonged time interval without requesting a new one.
OK I see where you are going with this, a bit like a NOOP to an FTP server.

I guess the only factor that determines whether it is a good idea is how expensive it is for Smugmug's backend to hold a connection open.

For example in quite a few database setups it's preferable to re-authenticate because the connection pool is quite constrained. I guess we'd need input from Smugmug's engineers on that one.

Luke
__________________
Photography: www.lukechurchphotography.com
SmugSoftware: www.smugtools.com

Last edited by luke_church; Nov-28-2004 at 02:58 PM. Reason: Markup edit
Old Nov-28-2004, 03:08 PM
#5
Andy is offline Andy
panasonikon
Andy's Avatar
carry on, boyz
and welcome to dgrin, luke nice to have you and your expertise here
__________________
Andy
Moon River PhotographyWorkshopsGoogle+FacebookTwitter
Old Nov-28-2004, 03:09 PM
#6
Nikolai is offline Nikolai OP
Darth SLR
Nikolai's Avatar
Yep, exactly like NOOP..
Quote:
Originally Posted by luke_church
Hi Nikolai,

OK I see where you are going with this, a bit like a NOOP to an FTP server.

I guess the only factor that determines whether it is a good idea is how expensive it is for Smugmug's backend to hold a connection open.

For example in quite a few database setups it's preferable to re-authenticate because the connection pool is quite constrained. I guess we'd need input from Smugmug's engineers on that one.

Luke
Yeah, I guess so. Besides. actually, I already managed to simple "fallback-safe" login code and will add similar logic to all the requests:
  1. try post,
  2. if not - try login with hash,
  3. if not - try login with password,
  4. post if success, fail otherwise.
Steps ##2,3 are already in place, now only need to make post fail-smart:-)

That NOOP-like method would give me a good starting point :
  1. NOOP,
  2. if not - try login with hash,
  3. if not - try login with password,
  4. post if success, fail otherwise.
I'm churning on with my code, hopefully will be done with manual stuff today, and then to the fun part - asyncronous mass/batch uploads:-). Also figured out how to do some "unofficiall" stuff, I mean actions that are not (yet? ever?) available via RPC-XML, but readily available via simple posts:-)

Stay tumed, it's commmmmming:-)

Cheers
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Dec-03-2004, 01:43 AM
#7
luke_church is offline luke_church
#Grinner
Cheers Andy
Quote:
Originally Posted by andy
and welcome to dgrin, luke nice to have you and your expertise here
Thanks Andy, happy to be here :)

I saw your email a while back, my hands are improving thanks... Few more months then I should be able to type again properly :)
__________________
Photography: www.lukechurchphotography.com
SmugSoftware: www.smugtools.com
Old Dec-03-2004, 10:31 AM
#8
onethumb is offline onethumb
SmugMug CEO & Chief Geek
onethumb's Avatar
Quote:
Originally Posted by Nikolai
Thank you very much for the detailed answer!
I think I inadvertedly shifted the focus of my own message towards the security/identity theft, to which, I agree, you have very valid points.
However, my primary reason for this request was simply trying to avoid "zomby client" effect and also avoid unnecessary relogins. I asked before about the "session logevity period", but unfortunately didn't get any answers.
So I was thinking of "ping" as a lightweight "are you there? I am here!" message, which would prevent session ID from expiration and allow the app to use it for a prolonged time interval without requesting a new one.

Thanks!
Sessions last for 6 hours of inactivity and are then retired. :)

Don
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump