Merge pull request #1533 from Lurkars/oidcRequired

use OIDC without admin api, option to disable anonymous login

Thanks for your work @Lurkars. I will take your changes and apply some update. When I will finish, I will  share you the result and requirement for mounting correct openid connection with puhser and without ADMIN part 💪  🚀
This commit is contained in:
grégoire parant 2021-11-12 16:39:15 +01:00 committed by GitHub
commit c1788424b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 47 additions and 15 deletions

View file

@ -42,11 +42,22 @@ class ConnectionManager {
localUserStore.setAuthToken(null);
//TODO fix me to redirect this URL by pusher
if (!this._currentRoom || !this._currentRoom.iframeAuthentication) {
if (!this._currentRoom) {
loginSceneVisibleIframeStore.set(false);
return null;
}
const redirectUrl = new URL(`${this._currentRoom.iframeAuthentication}`);
// also allow OIDC login without admin API by using pusher
let redirectUrl: URL;
if (this._currentRoom.iframeAuthentication) {
redirectUrl = new URL(`${this._currentRoom.iframeAuthentication}`);
} else {
// need origin if PUSHER_URL is relative (in Single-Domain-Deployment)
redirectUrl = new URL(
`${PUSHER_URL}/login-screen`,
!PUSHER_URL.startsWith("http:") || !PUSHER_URL.startsWith("https:") ? window.location.origin : undefined
);
}
redirectUrl.searchParams.append("state", state);
redirectUrl.searchParams.append("nonce", nonce);
redirectUrl.searchParams.append("playUri", this._currentRoom.key);