Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(authentication): Drops not needed tokenAuthUrlAutoRedirect.

damenchoa6422882dd6e
diff --git a/config.js b/config.js
index 2724e41082..d8a11353c5 100644
--- a/config.js
+++ b/config.js
@@ -1601,9 +1601,6 @@ var config = {
// - electron=true (when web is loaded in electron app)
// If there is a logout service you can specify its URL with:
// tokenLogoutUrl: 'https://myservice.com/logout'
- // You can enable tokenAuthUrlAutoRedirect which will detect that you have logged in successfully before
- // and will automatically redirect to the token service to get the token for the meeting.
- // tokenAuthUrlAutoRedirect: false
// An option to respect the context.tenant jwt field compared to the current tenant from the url
// tokenRespectTenant: false,
// An option to get for user info (name, picture, email) in the token outside the user context.
diff --git a/react/features/authentication/actionTypes.ts b/react/features/authentication/actionTypes.ts
index 34e46c19b1..0749587d69 100644
--- a/react/features/authentication/actionTypes.ts
+++ b/react/features/authentication/actionTypes.ts
@@ -26,16 +26,6 @@ export const LOGIN = 'LOGIN';
*/
export const LOGOUT = 'LOGOUT';
-/**
- * The type of (redux) action which signals that we have authenticated successful when
- * tokenAuthUrl is set.
- *
- * {
- * type: SET_TOKEN_AUTH_URL_SUCCESS
- * }
- */
-export const SET_TOKEN_AUTH_URL_SUCCESS = 'SET_TOKEN_AUTH_URL_SUCCESS';
-
/**
* The type of (redux) action which signals that the cyclic operation of waiting
* for conference owner has been aborted.
diff --git a/react/features/authentication/actions.any.ts b/react/features/authentication/actions.any.ts
index 15152ecc35..03eba188ad 100644
--- a/react/features/authentication/actions.any.ts
+++ b/react/features/authentication/actions.any.ts
@@ -8,7 +8,6 @@ import {
ENABLE_MODERATOR_LOGIN,
LOGIN,
LOGOUT,
- SET_TOKEN_AUTH_URL_SUCCESS,
STOP_WAIT_FOR_OWNER,
UPGRADE_ROLE_FINISHED,
UPGRADE_ROLE_STARTED,
@@ -242,16 +241,3 @@ export function waitForOwner() {
export function openLoginDialog() {
return openDialog('LoginDialog', LoginDialog);
}
-
-/**
- * Updates the config with new options.
- *
- * @param {boolean} value - The new value.
- * @returns {Function}
- */
-export function setTokenAuthUrlSuccess(value: boolean) {
- return {
- type: SET_TOKEN_AUTH_URL_SUCCESS,
- value
- };
-}
diff --git a/react/features/authentication/middleware.ts b/react/features/authentication/middleware.ts
index 239d1ea188..b5ed47c766 100644
--- a/react/features/authentication/middleware.ts
+++ b/react/features/authentication/middleware.ts
@@ -4,7 +4,6 @@ import {
CONFERENCE_JOINED,
CONFERENCE_LEFT
} from '../base/conference/actionTypes';
-import { isRoomValid } from '../base/conference/functions';
import { CONNECTION_ESTABLISHED, CONNECTION_FAILED } from '../base/connection/actionTypes';
import { hideDialog } from '../base/dialog/actions';
import { isDialogOpen } from '../base/dialog/functions';
@@ -16,7 +15,6 @@ import { MEDIA_TYPE } from '../base/media/constants';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { isLocalTrackMuted } from '../base/tracks/functions.any';
import { parseURIString } from '../base/util/uri';
-import { PREJOIN_JOINING_IN_PROGRESS } from '../prejoin/actionTypes';
import { openLogoutDialog } from '../settings/actions';
import {
@@ -35,7 +33,6 @@ import {
openTokenAuthUrl,
openWaitForOwnerDialog,
redirectToDefaultLocation,
- setTokenAuthUrlSuccess,
stopWaitForOwner,
waitForOwner
} from './actions';
@@ -126,25 +123,15 @@ MiddlewareRegistry.register(store => next => action => {
}
case CONFERENCE_JOINED: {
- const { dispatch, getState } = store;
- const state = getState();
- const config = state['features/base/config'];
-
- if (isTokenAuthEnabled(state)
- && config.tokenAuthUrlAutoRedirect
- && state['features/base/jwt'].jwt) {
- // auto redirect is turned on and we have successfully logged in
- // let's mark that
- dispatch(setTokenAuthUrlSuccess(true));
- }
+ const { dispatch } = store;
if (_isWaitingForModerator(store)) {
- store.dispatch(disableModeratorLogin());
+ dispatch(disableModeratorLogin());
}
if (_isWaitingForOwner(store)) {
- store.dispatch(stopWaitForOwner());
+ dispatch(stopWaitForOwner());
}
- store.dispatch(hideLoginDialog());
+ dispatch(hideLoginDialog());
break;
}
@@ -187,30 +174,6 @@ MiddlewareRegistry.register(store => next => action => {
break;
}
- case PREJOIN_JOINING_IN_PROGRESS: {
- if (!action.value) {
- break;
- }
-
- const { dispatch, getState } = store;
- const state = getState();
- const config = state['features/base/config'];
- const room = state['features/base/conference'].room;
-
- if (isRoomValid(room)
- && config.tokenAuthUrl && config.tokenAuthUrlAutoRedirect
- && state['features/authentication'].tokenAuthUrlSuccessful
- && !state['features/base/jwt'].jwt) {
- // if we have auto redirect enabled, and we have previously logged in successfully
- // we will redirect to the auth url to get the token and login again
- // we want to mark token auth success to false as if login is unsuccessful
- // the participant can join anonymously and not go in login loop
- dispatch(setTokenAuthUrlSuccess(false));
- }
-
- break;
- }
-
case STOP_WAIT_FOR_OWNER:
_clearExistingWaitForOwnerTimeout(store);
store.dispatch(hideDialog('WaitForOwnerDialog', WaitForOwnerDialog));
diff --git a/react/features/authentication/reducer.ts b/react/features/authentication/reducer.ts
index 077fd6aa25..886f7bd988 100644
--- a/react/features/authentication/reducer.ts
+++ b/react/features/authentication/reducer.ts
@@ -1,4 +1,3 @@
-import PersistenceRegistry from '../base/redux/PersistenceRegistry';
import ReducerRegistry from '../base/redux/ReducerRegistry';
import { assign } from '../base/redux/functions';
@@ -6,7 +5,6 @@ import {
CANCEL_LOGIN,
DISABLE_MODERATOR_LOGIN,
ENABLE_MODERATOR_LOGIN,
- SET_TOKEN_AUTH_URL_SUCCESS,
STOP_WAIT_FOR_OWNER,
UPGRADE_ROLE_FINISHED,
UPGRADE_ROLE_STARTED,
@@ -20,17 +18,9 @@ export interface IAuthenticationState {
thenableWithCancel?: {
cancel: Function;
};
- tokenAuthUrlSuccessful?: boolean;
waitForOwnerTimeoutID?: number;
}
-/**
- * Sets up the persistence of the feature {@code authentication}.
- */
-PersistenceRegistry.register('features/authentication', {
- tokenAuthUrlSuccessful: true
-});
-
/**
* Listens for actions which change the state of the authentication feature.
*
@@ -53,11 +43,6 @@ ReducerRegistry.register<IAuthenticationState>('features/authentication',
showModeratorLogin: true
});
- case SET_TOKEN_AUTH_URL_SUCCESS:
- return assign(state, {
- tokenAuthUrlSuccessful: action.value
- });
-
case STOP_WAIT_FOR_OWNER:
return assign(state, {
error: undefined,
diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts
index bef1742d5f..4a1e4d6ff1 100644
--- a/react/features/base/config/configType.ts
+++ b/react/features/base/config/configType.ts
@@ -618,7 +618,6 @@ export interface IConfig {
};
tokenAuthInline?: boolean;
tokenAuthUrl?: string;
- tokenAuthUrlAutoRedirect?: string;
tokenGetUserInfoOutOfContext?: boolean;
tokenLogoutUrl?: string;
tokenRespectTenant?: boolean;
diff --git a/react/features/prejoin/components/web/Prejoin.tsx b/react/features/prejoin/components/web/Prejoin.tsx
index 6bb8eb99b9..5a7e0e7863 100644
--- a/react/features/prejoin/components/web/Prejoin.tsx
+++ b/react/features/prejoin/components/web/Prejoin.tsx
@@ -5,14 +5,9 @@ import { connect, useDispatch } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
import { IReduxState } from '../../../app/types';
-import { loginWithPopup } from '../../../authentication/actions.web';
-import { getTokenAuthUrl, isTokenAuthEnabled, isTokenAuthInline } from '../../../authentication/functions.web';
import Avatar from '../../../base/avatar/components/Avatar';
-import { IConfig } from '../../../base/config/configType';
import { isNameReadOnly } from '../../../base/config/functions.web';
import { IconArrowDown, IconArrowUp, IconPhoneRinging, IconVolumeOff } from '../../../base/icons/svg';
-import { setJWT } from '../../../base/jwt/actions';
-import { browser } from '../../../base/lib-jitsi-meet';
import { isVideoMutedByUser } from '../../../base/media/functions';
import { getLocalParticipant } from '../../../base/participants/functions';
import Popover from '../../../base/popover/components/Popover.web';
@@ -25,7 +20,6 @@ import Button from '../../../base/ui/components/web/Button';
import Input from '../../../base/ui/components/web/Input';
import { BUTTON_TYPES } from '../../../base/ui/constants.any';
import isInsecureRoomName from '../../../base/util/isInsecureRoomName';
-import { parseURIString } from '../../../base/util/uri';
import { openDisplayNamePrompt } from '../../../display-name/actions';
import { isUnsafeRoomWarningEnabled } from '../../../prejoin/functions';
import {
@@ -127,16 +121,6 @@ interface IProps {
*/
showUnsafeRoomWarning: boolean;
- /**
- * The configuration for token pre-authentication, if applicable.
- */
- tokenPreAuthConfig?: {
- config: IConfig;
- locationURL: URL;
- refreshToken: string | undefined;
- room: string;
- };
-
/**
* Whether the user has approved to join a room with unsafe name.
*/
@@ -242,7 +226,6 @@ const Prejoin = ({
showErrorOnJoin,
showRecordingWarning,
showUnsafeRoomWarning,
- tokenPreAuthConfig,
unsafeRoomConsent,
updateSettings: dispatchUpdateSettings,
videoTrack
@@ -276,56 +259,7 @@ const Prejoin = ({
logger.info('Prejoin join button clicked.');
- // if we have auto redirect enabled, and we have previously logged in successfully
- // let's redirect to the auth url to get the token and login again
- if (tokenPreAuthConfig) {
- const { tenant } = parseURIString(tokenPreAuthConfig.locationURL.href) || {};
- const { startAudioOnly } = tokenPreAuthConfig.config;
- const refreshToken = tokenPreAuthConfig.refreshToken;
-
- getTokenAuthUrl(
- config,
- tokenPreAuthConfig.locationURL,
- {
- audioMuted: false,
- audioOnlyEnabled: startAudioOnly,
- skipPrejoin: true,
- videoMuted: false
- },
- tokenPreAuthConfig.room,
- tenant,
- refreshToken
- )
- .then((url: string | undefined) => {
- if (isTokenAuthInline(config)) {
- if (url) {
- return loginWithPopup(url)
- .then((result: { accessToken: string; idToken: string; refreshToken?: string; }) => {
- // @ts-ignore
- const token: string = result.accessToken;
- const idToken: string = result.idToken;
- const newRefreshToken: string | undefined = result.refreshToken;
-
- // @ts-ignore
- dispatch(setJWT(token, idToken, newRefreshToken || refreshToken));
- })
- .then(() => joinConference());
- }
- } else {
- if (url) {
- window.location.href = url;
- } else {
- joinConference();
- }
- }
- })
- .catch(err => {
- logger.error('Error in login', err);
- joinConference();
- });
- } else {
- joinConference();
- }
+ joinConference();
};
/**
@@ -570,11 +504,6 @@ function mapStateToProps(state: IReduxState) {
const { unsafeRoomConsent } = state['features/base/premeeting'];
const config = state['features/base/config'];
const { showPrejoinWarning: showRecordingWarning } = config.recordings ?? {};
- const preTokenAuthenticate = !browser.isElectron()
- && isTokenAuthEnabled(state)
- && config.tokenAuthUrlAutoRedirect && state['features/authentication'].tokenAuthUrlSuccessful
- && !state['features/base/jwt'].jwt && room; // skip if jaas
- const { locationURL = { href: '' } as URL } = state['features/base/connection'];
return {
deviceStatusVisible: isDeviceStatusVisible(state),
@@ -590,12 +519,6 @@ function mapStateToProps(state: IReduxState) {
showErrorOnJoin,
showRecordingWarning: Boolean(showRecordingWarning),
showUnsafeRoomWarning: isInsecureRoomName(room) && isUnsafeRoomWarningEnabled(state),
- tokenPreAuthConfig: preTokenAuthenticate ? {
- config,
- locationURL,
- refreshToken: state['features/base/jwt'].refreshToken,
- room
- } : undefined,
unsafeRoomConsent,
videoTrack: getLocalJitsiVideoTrack(state)
};
diff --git a/react/features/settings/actions.web.ts b/react/features/settings/actions.web.ts
index 80e190032b..30708d2c72 100644
--- a/react/features/settings/actions.web.ts
+++ b/react/features/settings/actions.web.ts
@@ -1,8 +1,8 @@
import { batch } from 'react-redux';
import { IStore } from '../app/types';
-import { setTokenAuthUrlSuccess, silentLogout } from '../authentication/actions.web';
-import { isTokenAuthEnabled, isTokenAuthInline } from '../authentication/functions';
+import { silentLogout } from '../authentication/actions.web';
+import { isTokenAuthInline } from '../authentication/functions';
import {
setStartMutedPolicy,
setStartReactionsMuted
@@ -53,7 +53,7 @@ export function openLogoutDialog() {
const logoutUrl = config.tokenLogoutUrl;
const { conference } = state['features/base/conference'];
- const { jwt, idToken } = state['features/base/jwt'];
+ const { idToken } = state['features/base/jwt'];
if (!browser.isElectron() && logoutUrl && isTokenAuthInline(config)) {
let url = logoutUrl;
@@ -65,7 +65,6 @@ export function openLogoutDialog() {
silentLogout(url)
.then(() => {
dispatch(setJWT());
- dispatch(setTokenAuthUrlSuccess(false));
})
.catch(() => logger.error('logout failed'));
@@ -74,12 +73,6 @@ export function openLogoutDialog() {
dispatch(openDialog('LogoutDialog', LogoutDialog, {
onLogout() {
- if (isTokenAuthEnabled(state) && config.tokenAuthUrlAutoRedirect && jwt) {
-
- // user is logging out remove auto redirect indication
- dispatch(setTokenAuthUrlSuccess(false));
- }
-
if (logoutUrl && browser.isElectron()) {
const url = appendURLHashParam(logoutUrl, 'electron', 'true');