Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When I was investigating how to implement security for my own WCF RESTful service I spent some time looking at how other popular services like flickr and amazon implement their own security - assuming that they've probably spent far more time thinking about it than I have. Flickr's <a href="http://www.flickr.com/services/api/auth.spec.html">documentation</a> in particular helped shaped how I formated my signatures and requests.</p> <p>In the end I chose a HMAC (Hash-based Message Authentication Code) authentication scheme for my services.</p> <p>I created a custom HMAC ServiceAuthorizationManager that validates the signature of each request as it comes in. Each request contains the following:</p> <ul> <li>a user token</li> <li>timestamp</li> <li>nonce </li> <li>signature</li> </ul> <p>Using this information the manager can look up the user's secret from their token and can recreate the signature on the server using the provided information.</p> <p>My signature consists of an MD5 hash of the following (values are concatenated together in a specific order and hashed so the value can be repeated on the server):</p> <ul> <li>apikey </li> <li>userToken</li> <li>secret</li> <li>timestamp</li> <li>nonce</li> </ul> <p>I store the nonce's in a memcache instance for a short period of time in order to quickly check against any replay attacks. After that time skew (about 10 minutes) the timestamp is used to reject any other old requests.</p> <p>I can post some snippets of my code if it will help. In general I've found that the HMAC authentication is generally the safest way to go and is easily supported on any clients that will be using your service (not just .NET).</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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