mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -05:00
✨ Add the ability to select user info source
using the PENPOT_OIDC_USER_INFO_SOURCE environment variable with two possible values: token and userinfo
This commit is contained in:
parent
dda67af5cc
commit
8cda8924df
2 changed files with 8 additions and 2 deletions
|
@ -424,8 +424,12 @@
|
|||
code (get params :code)
|
||||
state (tokens/verify props {:token state :iss :oauth})
|
||||
tdata (fetch-access-token cfg code)
|
||||
info (or (get-user-info cfg tdata)
|
||||
(fetch-user-info cfg tdata))
|
||||
info (case (cf/get :oidc-user-info-source)
|
||||
:token (get-user-info cfg tdata)
|
||||
:userinfo (fetch-user-info cfg tdata)
|
||||
(or (get-user-info cfg tdata)
|
||||
(fetch-user-info cfg tdata)))
|
||||
|
||||
info (process-user-info provider tdata info)]
|
||||
|
||||
(l/trace :hint "user info" :info info)
|
||||
|
|
|
@ -146,6 +146,7 @@
|
|||
(s/def ::google-client-id ::us/string)
|
||||
(s/def ::google-client-secret ::us/string)
|
||||
(s/def ::oidc-client-id ::us/string)
|
||||
(s/def ::oidc-user-info-source ::us/keyword)
|
||||
(s/def ::oidc-client-secret ::us/string)
|
||||
(s/def ::oidc-base-uri ::us/string)
|
||||
(s/def ::oidc-token-uri ::us/string)
|
||||
|
@ -242,6 +243,7 @@
|
|||
::google-client-secret
|
||||
::oidc-client-id
|
||||
::oidc-client-secret
|
||||
::oidc-user-info-source
|
||||
::oidc-base-uri
|
||||
::oidc-token-uri
|
||||
::oidc-auth-uri
|
||||
|
|
Loading…
Reference in a new issue