mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 09:08:31 -05:00
✨ Update oidc impl with latest buddy-sign improvements
This commit is contained in:
parent
cadcc1607d
commit
dda67af5cc
1 changed files with 3 additions and 4 deletions
|
@ -25,8 +25,7 @@
|
||||||
[app.tokens :as tokens]
|
[app.tokens :as tokens]
|
||||||
[app.util.json :as json]
|
[app.util.json :as json]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[buddy.core.keys :as keys]
|
[buddy.sign.jwk :as jwk]
|
||||||
[buddy.sign.jws :as jws]
|
|
||||||
[buddy.sign.jwt :as jwt]
|
[buddy.sign.jwt :as jwt]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
|
@ -109,7 +108,7 @@
|
||||||
(defn- process-oidc-jwks
|
(defn- process-oidc-jwks
|
||||||
[keys]
|
[keys]
|
||||||
(reduce (fn [result {:keys [kid] :as kdata}]
|
(reduce (fn [result {:keys [kid] :as kdata}]
|
||||||
(let [pkey (ex/try! (keys/jwk->public-key kdata))]
|
(let [pkey (ex/try! (jwk/public-key kdata))]
|
||||||
(if (ex/exception? pkey)
|
(if (ex/exception? pkey)
|
||||||
(do
|
(do
|
||||||
(l/warn :hint "unable to create public key"
|
(l/warn :hint "unable to create public key"
|
||||||
|
@ -392,7 +391,7 @@
|
||||||
(defn- get-user-info
|
(defn- get-user-info
|
||||||
[{:keys [provider]} tdata]
|
[{:keys [provider]} tdata]
|
||||||
(try
|
(try
|
||||||
(let [{:keys [kid alg] :as theader} (jws/decode-header (:token/id tdata))]
|
(let [{:keys [kid alg] :as theader} (jwt/decode-header (:token/id tdata))]
|
||||||
(when-let [key (if (str/starts-with? (name alg) "hs")
|
(when-let [key (if (str/starts-with? (name alg) "hs")
|
||||||
(:client-secret provider)
|
(:client-secret provider)
|
||||||
(get-in provider [:jwks kid]))]
|
(get-in provider [:jwks kid]))]
|
||||||
|
|
Loading…
Add table
Reference in a new issue