<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite">The problem with this logic is that you are optimizing wrong.  In a token based auth system, the tokens are valid generally for a period of time (24 hours normally with Rackspace auth), and it is a best practice to cache this.  Saying that you are reducing HTTP requests for 1 request that has to happen every 24 hours isn't saving you that much.</blockquote><div><br></div><div>It depends.  If you're in a busy area of a big city with 1 bar of EDGE coverage on your phone, latency becomes your biggest connectivity issue.  So if you're only doing something with the API every 24 hours, auth could reasonably be close to 50% of the time you stare in frustration cursing your carrier.</div><div><br></div><div>For something that's doing a lot of things with the API (such as my apps), I agree with you.  Saving 1 request isn't that much of an improvement.  But I think a lot of people will want to use this differently than we do, particularly with swift.  Quite a few people are making iPhone apps that hard code their API Keys into the source code to offer some sort of social sharing functionality (uploading pictures, audio, video, or whatever), and what they see when testing without wifi is that uploading something is noticeably slower than doing it with S3 (which doesn't have an auth step; instead you sign the request).</div><div><br></div><div>Sure, if you cache the token, every upload after the first one will seem faster (for 24 hours) and probably comparable to S3, but why not make the first one fast too?</div><div><br></div><div>If I'm not making sense here, please let me know.  I don't want to troll this list or anything; just trying to suggest ways to make the API as nice as possible, particularly for mobile app developers.</div><div><br></div><div>Cheers!</div><div>Mike Mayo</div><div>@greenisus</div><div><br></div><br><blockquote type="cite"><div>But back to the auth questions in general, I would like to comment on a couple of things that have come up:</div><div><br></div><div>1.  Basic Auth - I'm not fond of this mainly because auth credentials (identification and secret) are sent, and have to be verified on every single request.  This also means that every endpoint is going to be handling the users' secrets for every request.  I think there is good precedent with no major service providers using basic auth (even including twitter moving away from basic auth, to OAuth)</div>
<div><br></div><div>2. Signed vs. Token based auth - Why not support both?  It isn't that complex.  It is also interesting that OAuth v1 was signature based, while OAuth v2 has moved to a token based auth system, so there is broad support in the general community for both methods.</div>
<div><br></div><div>--</div><div>Chuck</div><div><br><div class="gmail_quote">On Thu, Mar 3, 2011 at 2:59 PM, Michael Mayo <span dir="ltr"><<a href="mailto:mike@openstack.org">mike@openstack.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div>I was thinking more of a "sniff someone's traffic and perform those same requests again" sort of attack.  But then again, I'm an iPhone guy and not a security expert :)</div>
<div><br></div><div>In the end, I'm simply advocating that we reduce the number of HTTP requests needed to get information or get things done.  Getting rid of the auth server call is a first step.  Future steps could be things like including child entities in responses (for instance, getting a server list also returning complete image and flavor entities).  Then perhaps we could allow creates and actions to happen on multiple entities ("create 10 servers" instead of calling "create server" 10 times, reboot a set of servers, etc).</div>
<div><br></div><div>How we reduce API calls isn't that important to me.</div><div><br></div><div>Thanks!</div><div>Mike</div><div><div></div><div class="h5"><div><br></div><br><div><div>On Mar 3, 2011, at 12:52 PM, Jorge Williams wrote:</div>
<br><blockquote type="cite"><div style="word-wrap:break-word">
<div><br>
</div>
<div>I think you're overestimating the security risk in issue 3.  You're bank's website uses HTTPS.  In order to launch a successful man-in-the middle attack against it you would have to compromise the certificate authority.  Basic Auth with HTTPS against a
 single endpoint is pretty darn secure and no more secure than option 1.  The big advantage of 2 is that you can initiate conversations *without* HTTPS, there may be cases when you'd want to do that, but seeing that we have the potential to move passwords around
 when we create servers,  I don't see why you would want to go that route.  Using a token becomes important when we start talking about delegation, but let's not go there right now :-)</div>
<div><br>
</div>
<div>-jOrGe W.</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div>
<div>On Mar 3, 2011, at 2:33 PM, Michael Mayo wrote:</div>
<br>
<blockquote type="cite">
<div style="word-wrap:break-word">
<div>Here are my thoughts, as a client developer:</div>
<div><br>
</div>
<div><b>1. Hit auth server first for token, then hit compute and storage endpoints</b></div>
<div><br>
</div>
<div>This is fairly simple, but there are a couple of problems with it:</div>
<div><br>
</div>
<div>a. It's not very curl or browser friendly (you have to curl the auth server first and copy the token, which is annoying)</div>
<div>b. It's a waste of an HTTP request.  That may not matter for most people, but in the case of something like a mobile client, it's a serious problem.  Network traffic is a very precious resource on cell phones, so if you can do anything to reduce the number
 of HTTP requests you need to do something, you should.  This is not only true for the OpenStack mobile apps I write, but also for developers making apps that need to use swift to upload content somewhere.</div>
<div><br>
</div>
<div><b>2. Signed requests</b></div>
<div><br>
</div>
<div>This is a little more painful from a development standpoint, but it's not really that big of a deal.  The only downside to this approach is that it's not curl or browser friendly.  However, the upside of preventing replay attacks is pretty valuable.</div>

<div><br>
</div>
<div><b>3. HTTP Basic</b></div>
<div><br>
</div>
<div>HTTP Basic is great because it's super easy to use and it's curl and browser friendly.  However, replay attacks are possible so you open yourself up to a security issue there.</div>
<div><br>
</div>
<div><b>My Vote (Assuming I Actually Have One)</b></div>
<div><br>
</div>
<div>I think signed requests are the best option since it's more secure than HTTP Basic.  We could make an oscurl command line tool that would sign a request and behave exactly like curl.  That shouldn't be too hard.  But if that can't happen, HTTP Basic is
 the next best choice.  Requiring API users to get a new auth token every n hours via an auth endpoint kind of sucks, especially from a mobile client perspective.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>On Mar 3, 2011, at 9:04 AM, Jorge Williams wrote:</div>
<br>
<blockquote type="cite">
<div><br>
<br>
I agree with Greg here.  Signatures complicate life for our clients, they are not browser friendly, and I'm not really convinced that we need them. If we are going to have a default (and I think that we should) it should be dead simple to integrate with.   I
 would vote for basic auth with https.  <br>
<br>
-jOrGe W.<br>
<br>
On Mar 3, 2011, at 9:40 AM, Greg wrote:<br>
<br>
<blockquote type="cite">On Mar 2, 2011, at 8:30 PM, Jesse Andrews wrote:<br>
</blockquote>
<blockquote type="cite"><br>
</blockquote>
<blockquote type="cite">
<blockquote type="cite">I would prefer a signature based approach as the default (as signatures limits replay attacks; tokens allow an eavesdropper to make arbitrary requests if they obtain a token).<br>
</blockquote>
</blockquote>
<blockquote type="cite"><br>
</blockquote>
<blockquote type="cite">On the other hand, signatures make simple things difficult, such as quick curl requests, dev testing, etc. The usual tradeoff of security and convenience.<br>
</blockquote>
<blockquote type="cite">_______________________________________________<br>
</blockquote>
<blockquote type="cite">Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">
https://launchpad.net/~openstack</a><br>
</blockquote>
<blockquote type="cite">Post to     : <a href="mailto:openstack@lists.launchpad.net" target="_blank">
openstack@lists.launchpad.net</a><br>
</blockquote>
<blockquote type="cite">Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">
https://launchpad.net/~openstack</a><br>
</blockquote>
<blockquote type="cite">More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">
https://help.launchpad.net/ListHelp</a><br>
</blockquote>
<br>
<br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</div>
</blockquote>
</div>
<br>
<div><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">
<div>
<div>
<div>Mike Mayo</div>
<div>901-299-9306</div>
<div>@greenisus</div>
</div>
<div><br>
</div>
</div>
</span><br>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>

</blockquote></div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div>
<div><div>Mike Mayo</div><div>901-299-9306</div><div>@greenisus</div></div><div><br></div></div></span><br>
</div>
<br></div></div></div><br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div><div>Mike Mayo</div><div>901-299-9306</div><div>@greenisus</div></div><div><br></div></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>