anchor.diff:      (response "Hello Anonymous")))
   ----
   
  -.Middleware usage example
  -[source,clojure]
  -----
  -;; Import middleware function and backend constructor
  -
  +.Create an instance of authentication backend.
  +[source, clojure]
  +----
   (require '[buddy.auth.backends.httpbasic :refer [http-basic-backend]])
  -(require '[buddy.auth.middleware :refer [wrap-authentication]])
  -
  -;; This function always receives request and authdata, authdata
  -;; can vary with other backends. For http basic backend, authdata
  -;; parameter has the form {:username xxxx :password yyyy}
  +
  +;; Http Basic backend in this case requires one function with parameter
  +;; that takes a responsability to identify the incoming request.
  +
  +;; The required function is caled in authentication of parsed data
  +;; and it receives the current ring request and parsed data from parse
  +;; phase of authentication.
   ;;
   ;; This function should return a non-nil value that
   ;; is automatically stored on :identity key on request
  
positive.code: HTTP Basic
  ^^^^^^^^^^
  
  The HTTP Basic authentication backend is one of the simplest and most
  insecure authentication systems, but it works well as a first
  introduction of authentication with _buddy_.
  
  .Simple handler definition
  [source,clojure]
  ----
  (require '[buddy.auth :refer (authenticated?)])
  
negative.code:   [request, authdata]
    (let [username (:username authdata)
          password (:password authdata)]
      username))
  
  (def backend (http-basic-backend :realm "MyApi" :authfn my-authfn))
  ----
  
  
  Now having simple view function and backend defined, you should wrap it
  in a standard ring middleware way with buddy's authentication middleware.
  
  .Declare auth function and create ring app with wrapped handler.
  [source,clojure]
  ----
  (require '[buddy.auth.middleware :refer [wrap-authentication]])
  
  ;; Define the main handler with *app* name wrapping it
  ;; with authentication middleware using an instance of
  ;; just created http-basic backend.
  
  ;; Define app var with handler wrapped with buddy's authentication
  ;; middleware using just previously defined backend.
  
  (def app (wrap-authentication handler backend))
  ----
  
  Now, all incoming request with basic auth header are properly parsed and
  request with `:identity` forwarded to real handler or next middleware.
  
  
  Session
  