ring

Jakub Zika 2020-03-23T08:16:29.005700Z

These are routes:

(defroutes routes
  (GET "/" [] greet)
  (GET "/request" [] handle-dump) ;; will be used later for debuging
  (GET "/status" [] handle-driver-status)
  (GET "/login" [] handle-dump)
  (GET "/login/loopback" [] (response/redirect "/"))
  (not-found "Page not found"))
(As I said I am not sure what to do on "login/loopback" which is "redirect_uri", "/" is landing page)
(def app
  (wrap-file-info
   (wrap-resource
    (wrap-params 
     (middleware/wrap-format
      (
       idp-handler
       routes
       )
      ))
    "public")))   
And this is the handler.
(defn idp-handler [routes]
  (wrap-oauth2
   routes
   {:xxx
    {:authorize-uri    "<https://idp.xxx.com/nidp/oauth/nam/authz>"
     :access-token-uri "<https://idp.xxx.com/nidp/oauth/nam/token>"
     :client-id        "????
     :client-secret    "????"
     :scopes           ["openid xxxx"]
     :grant-type       "refresh_token,authorization_code"
     :launch-uri       "/login"
     :redirect-uri     "<https://xxxxxxxx/login/loopback>"
     :landing-uri      "/"}}))