Christoph.Krn
Advanced Member
Don't implement it that way -- it allows for replay attacks and is very dangerous.cloudef ok ill look at this simple method tomorrow.
Don't implement it that way -- it allows for replay attacks and is very dangerous.cloudef ok ill look at this simple method tomorrow.
Don't implement it that way -- it allows for replay attacks and is very dangerous.cloudef ok ill look at this simple method tomorrow.
Second, what is this about API keys? A user must log in to the repo, request the key, then give that key to the client, correct? That seems unnecessarily cumbersome when we already have secret passwords. And though I don't quite follow your code, it looks similar to digest authentication, but uses a client-generated nonce instead of a server-generated one. So I still think digest authentication is a better idea, as it's a long-standing standard. But you're the new master of repo clients, so it's ultimately up to you . Consider it.
Tempel is right, ultimately it's up to you, but I must strongly oppose this reasoning. The way I see it, if the security of something is screwed up, then it's broke.About the digest authentication, it might be overkill as breaking the API access won't give you full access to the user's account anyways. And this method is already fairly secure, heck it's more secure than browser's authentication to repository right now.
If you want to do it this way, you need not save the user's password if you only use it to authenticate her once so as to negotiate the API key.
Even hashed, as allowed for by digest authentication? Security is about leveraging secrets; the password is already secret, so leverage it some more. Making users manage API keys is just a hassle when they don't need to. Also, I like repeating: existing standard.I don't really like storing user's passwords anywhere even encrypted.
I was kind of hoping he'd be reading this. Maybe direct him to these comments.But this isn't up to me, I'm not deciding the standards here. Milkshake's currently the one who has the 'main' repository and he pretty much holds the cards here, if you wan't different authentication method you can go suggest it to him and I'll follow behind.
Yes, call me paranoid, on that part.Even hashed, as allowed for by digest authentication?
Yeah, I suggested OAuth for milkshake_, but I guess it was too much.Security is about leveraging secrets; the password is already secret, so leverage it some more. Making users manage API keys is just a hassle when they don't need to. Also, I like repeating: existing standard.
I'm more of the type who can suggest something, but ultimately leaves the decision to others and follows with it. I'm not really security expert nor design person by any means.More importantly, it takes two to tango. Both of you need to buy in to make this system work. For that matter, this is a community-defined specification. Milkshake doesn't own it any more than the rest of us. And it's up to all of us to create a specification that makes sense no matter who implements it.
there is a client nonce and a server generated nonce not just a client one.And though I don't quite follow your code, it looks similar to digest authentication, but uses a client-generated nonce instead of a server-generated one. So I still think digest authentication is a better idea, as it's a long-standing standard. But you're the new master of repo clients, so it's ultimately up to you . Consider it.
//---------> through POST method client sends request for handshake by POST param stage=1
//<--------- the client generates a new session (which lasts only 15 seconds), generates a
random 12 digit NONCE sequance and returns this value to the client.
//---------> once the client has this NONCE it generates its own client NONCE and POSTs
this back to the server along with the username of the user and a special md5 hash
which works like this md5(NONCE+CNONCE+APIKEY). So the following gets posted
back to the server:
stage=2&user=<username>&hash=md5(NONCE+CNONCE+APIKEY)
//<--------- as long as the session on the server is still active, the server pulls up the
users APIKEY from the db and replicates the client submitted HASH for validation i.e.
md5(NONCE+CNONCE+APIKEY), the server then checks both hashes against each
other (client hash and server hash) and if they match we allow an action, after which
the session is destroyed again.
//if there are any errors in the POST or missing required params the session is
destroyed and the handshake needs to start again.
I take my review duty serious at repo.openpandora.net