Possibility to configure an OpenID Connect provider on the instance level WIP (#128).
This commit is contained in:
@ -16,13 +16,20 @@ export async function diagExternalAuthCustomOIDC (test: string, _options: Regist
|
||||
return result
|
||||
}
|
||||
|
||||
const errors = await oidc.check()
|
||||
if (errors.length) {
|
||||
result.messages.push('Discovery URL: ' + (oidc.getDiscoveryUrl() ?? 'undefined'))
|
||||
|
||||
const oidcErrors = await oidc.check()
|
||||
if (oidcErrors.length) {
|
||||
result.messages.push({
|
||||
level: 'error',
|
||||
message: 'The ExternalAuthOIDC singleton got some errors:'
|
||||
})
|
||||
result.messages.push(...errors)
|
||||
for (const oidcError of oidcErrors) {
|
||||
result.messages.push({
|
||||
level: 'error',
|
||||
message: oidcError
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
} catch (err) {
|
||||
@ -33,6 +40,18 @@ export async function diagExternalAuthCustomOIDC (test: string, _options: Regist
|
||||
return result
|
||||
}
|
||||
|
||||
const oidc = ExternalAuthOIDC.singleton()
|
||||
const issuer = await oidc.loadIssuer()
|
||||
if (issuer) {
|
||||
result.messages.push('Discovery URL loaded: ' + JSON.stringify(issuer.metadata))
|
||||
} else {
|
||||
result.messages.push({
|
||||
level: 'error',
|
||||
message: 'Failed to load the Discovery URL.'
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
result.ok = true
|
||||
result.messages.push('Configuration OK.')
|
||||
return result
|
||||
|
Reference in New Issue
Block a user