                         {:content-type     :json
                          :oauth-token      token
                          :throw-exceptions false
-                         :body             {:policy  policy
-                                            :payload {:team team}}})]
+                         :body             (json/encode {:policy  policy
+                                                         :payload {:team team}})})]
     (= 200 (:status auth-response))))
 
 (defn get-auth

      true
      (let [policy      (get-in request [:configuration :magnificent-policy] "relaxed-radical-agility")
            token       (get-in request [:tokeninfo "access_token"])
            user        (get-in request [:tokeninfo "uid"] "unknown user")
            has-access? (fetch-auth magnificent-url policy team token)]
        (log/info (str "Access to team" team (if has-access? "granted" "denied") "to" user))
        has-access?))))

(defn require-auth

(ns org.zalando.stups.friboo.auth
  (:require [clj-http.client :as http]
            [cheshire.core :as json]
            [org.zalando.stups.friboo.ring :as r]
            [org.zalando.stups.friboo.config :refer [require-config]]
            [org.zalando.stups.friboo.log :as log]
