OIDC: enable non standard claims in admin check (#230)

* OIDC: enable non standard claims in admin check

* give priority to UserInfo
This commit is contained in:
Juan Zuloaga
2026-09-09 20:11:43 +02:00
committed by GitHub
parent 4156d6e1a6
commit 32c6e48863
2 changed files with 4 additions and 2 deletions
@@ -53,7 +53,8 @@ const OIDCAuthenticationController = {
}
)(req, res, next)
},
async doPassportLogin(req, issuer, profile, context, idToken, accessToken, refreshToken, done) {
async doPassportLogin(req, issuer, uiProfile, idProfile, context, idToken, accessToken, refreshToken, params, done) {
const profile = uiProfile ?? idProfile //id Profile if _skipUserProfile is true
let user, info
try {
if(req.session.intent === 'link') {
@@ -23,7 +23,8 @@ const OIDCAuthenticationManager = {
if (attAdmin === 'email') {
isAdmin = (email === valAdmin)
} else {
isAdmin = (profile[attAdmin] === valAdmin)
const adminClaim = profile[attAdmin] || profile._json?.[attAdmin]
isAdmin = (adminClaim === valAdmin)
}
}
const oidcUserData = null // Possibly it can be used later