                   granted-scopes (set/intersection permitted-scopes requested-scopes)
                   code (:code session)
                   client-id (:client-id session)
-                  {:keys [redirection-uri] :as client} (lookup-client+ (:client-registry this) client-id)
+                  {:keys [redirection-uri] :as client} (lookup-client+ (:client-registry component) client-id)
                   ]
 
               (debugf "Granting scopes: %s" granted-scopes)

           (let [params (:form-params req)
                 code (get params "code")
                 client-id (get params "client_id")
                 client (lookup-client+ (:client-registry this) client-id)]

             ;; "When making the request, the client authenticates with
             ;; the authorization server."

                 scope)))

  RequestAuthorizer
  (request-authorized? [component request scope]
    (when-let [auth-header (get (:headers request) "authorization")]
      (let [access-token (second (re-matches #"\Qtoken\E\s+(.*)" auth-header))]
        (authorized? component access-token scope)))))

(defn new-authorization-server [& {:as opts}]
  (->> opts
