diff --git a/src/core/features/login/pages/credentials/credentials.ts b/src/core/features/login/pages/credentials/credentials.ts index 9f283db301a..e6b995c0620 100644 --- a/src/core/features/login/pages/credentials/credentials.ts +++ b/src/core/features/login/pages/credentials/credentials.ts @@ -106,6 +106,10 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy { await this.checkSite(); + if (this.isBrowserSSO && CoreLoginHelper.shouldSkipCredentialsScreenOnSSO()) { + this.openBrowserSSO(); + } + if (CorePlatform.isIOS() && !this.isBrowserSSO) { // Make iOS auto-fill work. The field that isn't focused doesn't get updated, do it manually. // Debounce it to prevent triggering this function too often when the user is typing. diff --git a/src/core/features/login/services/login-helper.ts b/src/core/features/login/services/login-helper.ts index 0876b58ccff..3ae5297f3e5 100644 --- a/src/core/features/login/services/login-helper.ts +++ b/src/core/features/login/services/login-helper.ts @@ -903,11 +903,19 @@ export class CoreLoginHelperProvider { * * @param typeOfLogin TypeOfLogin.BROWSER or TypeOfLogin.EMBEDDED. * @returns True if confirm modal should be shown, false otherwise. - * @deprecated since 4.3 Not used anymore. + * @deprecated since 4.3 Not used anymore. See shouldSkipCredentialsScreenOnSSO. */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars shouldShowSSOConfirm(typeOfLogin: TypeOfLogin): boolean { - return false; + return !this.isSSOEmbeddedBrowser(typeOfLogin) && !this.shouldSkipCredentialsScreenOnSSO(); + } + + /** + * Check if we can skip credentials page. + * + * @returns If true, the browser should be opened without the user prompt. + */ + shouldSkipCredentialsScreenOnSSO(): boolean { + return String(CoreConstants.CONFIG.skipssoconfirmation) === 'true'; } /** diff --git a/src/types/config.d.ts b/src/types/config.d.ts index cb34209a91b..49743638d2f 100644 --- a/src/types/config.d.ts +++ b/src/types/config.d.ts @@ -46,6 +46,7 @@ export interface EnvironmentConfig { multisitesdisplay: CoreLoginSiteSelectorListMethod; sitefindersettings: Partial; onlyallowlistedsites: boolean; + skipssoconfirmation: boolean; forcedefaultlanguage: boolean; privacypolicy: string; notificoncolor: string;