mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-09 01:10:17 +00:00
UBERF-8500: Improve OIDC init logging (#6981)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
parent
f4393df8f3
commit
e9098372af
@ -38,13 +38,17 @@ export function registerOpenid (
|
|||||||
const redirectURL = '/auth/openid/callback'
|
const redirectURL = '/auth/openid/callback'
|
||||||
if (openidClientId === undefined || openidClientSecret === undefined || issuer === undefined) return
|
if (openidClientId === undefined || openidClientSecret === undefined || issuer === undefined) return
|
||||||
|
|
||||||
void Issuer.discover(issuer).then((issuerObj) => {
|
Issuer.discover(issuer)
|
||||||
|
.then((issuerObj) => {
|
||||||
|
measureCtx.info('Discovered issuer', { issuer: issuerObj })
|
||||||
|
|
||||||
const client = new issuerObj.Client({
|
const client = new issuerObj.Client({
|
||||||
client_id: openidClientId,
|
client_id: openidClientId,
|
||||||
client_secret: openidClientSecret,
|
client_secret: openidClientSecret,
|
||||||
redirect_uris: [concatLink(accountsUrl, redirectURL)],
|
redirect_uris: [concatLink(accountsUrl, redirectURL)],
|
||||||
response_types: ['code']
|
response_types: ['code']
|
||||||
})
|
})
|
||||||
|
measureCtx.info('Created OIDC client')
|
||||||
|
|
||||||
passport.use(
|
passport.use(
|
||||||
'oidc',
|
'oidc',
|
||||||
@ -52,6 +56,10 @@ export function registerOpenid (
|
|||||||
return done(null, userinfo)
|
return done(null, userinfo)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
measureCtx.info('Registered OIDC strategy')
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
measureCtx.error('Failed to create OIDC client for IdP with the provided configuration', { err })
|
||||||
})
|
})
|
||||||
|
|
||||||
router.get('/auth/openid', async (ctx, next) => {
|
router.get('/auth/openid', async (ctx, next) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user