Possibility to configure an OpenID Connect provider on the instance level WIP (#128).

This commit is contained in:
John Livingston
2024-04-17 18:30:39 +02:00
parent 3a5f27e751
commit 6c13d2e377
9 changed files with 139 additions and 24 deletions

View File

@ -107,7 +107,11 @@ async function initConverse (
let isAuthenticated: boolean = false
let isRemoteWithNicknameSet: boolean = false
const auth = await getLocalAuthentInfos(authenticationUrl, peertubeAuthHeader)
// OIDC (OpenID Connect):
const tryOIDC = !!initConverseParams.externalAuthOIDC
const auth = await getLocalAuthentInfos(authenticationUrl, tryOIDC, peertubeAuthHeader)
if (auth) {
if (!isRemoteChat) {
localRoomAuthenticatedParams(initConverseParams, auth, params)
@ -160,8 +164,11 @@ async function initConverse (
// no viewer mode if authenticated.
params.livechat_enable_viewer_mode = autoViewerMode && !isAuthenticated && !isRemoteWithNicknameSet
params.livechat_external_auth_oidc_button_label = initConverseParams.externalAuthOIDC?.buttonLabel
params.livechat_external_auth_oidc_url = initConverseParams.externalAuthOIDC?.url
if (tryOIDC && !isAuthenticated) {
params.livechat_external_auth_oidc_button_label = initConverseParams.externalAuthOIDC?.buttonLabel
params.livechat_external_auth_oidc_url = initConverseParams.externalAuthOIDC?.url
}
if (chatIncludeMode === 'peertube-video') {
params.livechat_mini_muc_head = true // we must replace the muc-head by the custom buttons toolbar.