Note that there are some explanatory texts on larger screens.

plurals
  1. POSOA - Signature Authorization Service - how to make the web interface to access user data
    primarykey
    data
    text
    <p>I've designed a REST Authorization Service that works pretty much like the <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/RESTAuthentication.html" rel="nofollow">Amazon S3 REST Authentication</a> and it's secure enough to work on HTTP (without requiring the overhead to make all intercomunications run on SSL).</p> <p>It's secure enough because the signature changes at each request and is subject to expiration. So it's safe against MITM (that cannot edit anything otherwise the endpoint won't be able to regenerate the same signature) and replay attacks (because of the timestamp usage).</p> <p>That's good for all clients, that knowing the private key, now can perform requested actions on their own data generating a unique signature containing the request data.</p> <p>The authorization service doesn't generate any token (so it cannot be subject to MITM attacks) and it is only called internally, meaning that a client performs a request directly to the right endpoint to perform certain operations, instead of requesting a token to give that service... then the endpoint receiving that request makes a query to the authorization service asking "hey, is this requested legit?" if so the authorization service returns "200 OK" and the service performs requested operations, otherwise it returns "401 Unauthorized".</p> <p>What I need now is to allow a special client, a web user interface, to make users login using email/password and use the webUI itself to obtain/edit their data. The webUI will run on HTTPS. Please, consider that creating a new account generates always both user/pwd login and pubkey/privatekey, but actually we're only using pubkey/privatekey. User and pwd are stored inside a db that will be used only by the WebUI, while the pubkey/privatekey is stored inside the Authorization Service (that uses another DB).</p> <p>Of course to work with customer data I need some way to make the webUI act as it is a client written for the logged user (that has a pubkey/privatekey associated pair to generate the signature). I'm not sure what's the safest way to do this so I'm going to explain several solutions I tought about.</p> <p>The 1st solution I tought is give the web interface its own pubkey/privatekey, making it a real client, and then edit the authorization service to recognize it and allow it to send the publickey (that can be retrieved by the authorization service) using a header like "X-Forwarded-For") and always trust the webUI authority. But I'm scared that somehow I'm missing something that could lead to attacks to exploit this authority to obtain the data you are not authorized for.</p> <p>The second solution would be, once logged in successfully, transfer both pubkey/privatekey from the Authorization Service to the WebUI that then stores it inside the session, and each time an action is performed it uses that data to generate a valid signature. But I don't really like to pass those data over network (also because this communication should be at least over SSL to avoid the privatekey to be sniffed), and I don't really like to have the private key stored inside a session backend.</p> <p>The last solution I tought about is rethink the authorization service and also allow authentication by user and password (that will be no more stored inside the webUI but togheter with pubkey/privatekey inside the Authorization Service). This would always require a SSL connection because the webui has to communicate email and password, but if logged correctly it could only store those data inside the session created. Another side effect would be that other services could be implemented to use user/pwd instead of using the signature method, that over HTTP would mean expose data to the world.</p> <p>I want the strongest and more logical solution, that makes the webUI act as a client because the entire architecture is thought to work on a client-server basis. I'm also available to accept other suggestions not listed here.</p> <p>Please, tell me if you need to know more to help me.</p> <p>Thank you (if you've read the whole post :-P)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload