-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mirotalksfu] - Enable OIDC support for alias domains with dynamic ba…
…seURL
- Loading branch information
1 parent
ddca05a
commit 6da22eb
Showing
5 changed files
with
28 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ dev dependencies: { | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.7.21 | ||
* @version 1.7.22 | ||
* | ||
*/ | ||
|
||
|
@@ -414,14 +414,29 @@ function startServer() { | |
} | ||
}); | ||
|
||
// OpenID Connect | ||
// OpenID Connect - Dynamically set baseURL based on incoming host and protocol | ||
if (OIDC.enabled) { | ||
try { | ||
app.use(auth(OIDC.config)); | ||
} catch (err) { | ||
log.error(err); | ||
process.exit(1); | ||
} | ||
const getDynamicConfig = (host, protocol) => { | ||
const baseURL = `${protocol}://${host}`; | ||
log.debug('OIDC baseURL', baseURL); | ||
return { | ||
...OIDC.config, | ||
baseURL, | ||
}; | ||
}; | ||
|
||
// Apply the authentication middleware using dynamic baseURL configuration | ||
app.use((req, res, next) => { | ||
const host = req.headers.host; | ||
const protocol = req.protocol === 'https' ? 'https' : 'http'; | ||
const dynamicOIDCConfig = getDynamicConfig(host, protocol); | ||
try { | ||
auth(dynamicOIDCConfig)(req, res, next); | ||
} catch (err) { | ||
log.error('OIDC Auth Middleware Error', err); | ||
process.exit(1); | ||
} | ||
}); | ||
} | ||
|
||
// Route to display user information | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.7.21 | ||
* @version 1.7.22 | ||
* | ||
*/ | ||
|
||
|
@@ -4905,7 +4905,7 @@ function showAbout() { | |
position: 'center', | ||
imageUrl: BRAND.about?.imageUrl && BRAND.about.imageUrl.trim() !== '' ? BRAND.about.imageUrl : image.about, | ||
customClass: { image: 'img-about' }, | ||
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.7.21', | ||
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.7.22', | ||
html: ` | ||
<br /> | ||
<div id="about"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.7.21 | ||
* @version 1.7.22 | ||
* | ||
*/ | ||
|
||
|